22#include "anch-rest-client-export.hpp"
35#include "codec/codec.hpp"
36#include "codec/codecs.hpp"
38#include "rest/bodyStream.hpp"
39#include "rest/filter.hpp"
40#include "rest/headers.hpp"
41#include "rest/httpError.hpp"
42#include "rest/method.hpp"
43#include "rest/paramConverter.hpp"
44#include "rest/request.hpp"
45#include "rest/response.hpp"
46#include "rest/transport.hpp"
61 std::unique_ptr<std::istream>
input;
67 std::optional<std::uint64_t>
size = std::nullopt;
83 template<
typename... Codecs>
120 Call&
header(std::string_view name, std::string_view value) &;
130 Call&&
header(std::string_view name, std::string_view value) &&;
140 template<anch::rest::ParameterValue T>
151 template<anch::rest::ParameterValue T>
173 template<
typename C,
typename T>
185 template<
typename C,
typename T>
196 Call&
body(std::string content, std::string_view contentType) &;
206 Call&&
body(std::string content, std::string_view contentType) &&;
218 Call&
body(std::unique_ptr<std::istream> input, std::string_view contentType, std::optional<std::uint64_t> size = std::nullopt) &;
229 Call&&
body(std::unique_ptr<std::istream> input, std::string_view contentType, std::optional<std::uint64_t> size = std::nullopt) &&;
308 std::unique_ptr<anch::rest::Transport> _transport;
311 std::string _baseUrl;
317 std::vector<anch::rest::Filter> _filters;
328 Client(std::unique_ptr<anch::rest::Transport> transport, std::string_view baseUrl);
462 static std::string
formatPath(std::string_view path,
const std::vector<std::string>& parameters);
480#include "rest/impl/client.hpp"
Call && body(const T &value) &&
Call && header(std::string_view name, std::string_view value) &&
Call && body(anch::rest::RawBody raw) &&
Call & header(std::string_view name, std::string_view value) &
anch::rest::Response send() &&
Call & query(std::string_view name, const T &value) &
Call & body(anch::rest::RawBody raw) &
anch::rest::Request & getRequest() noexcept
Call & body(std::unique_ptr< std::istream > input, std::string_view contentType, std::optional< std::uint64_t > size=std::nullopt) &
Call(anch::rest::Client &client, anch::rest::Request request)
Call && query(std::string_view name, const T &value) &&
Call && body(std::unique_ptr< std::istream > input, std::string_view contentType, std::optional< std::uint64_t > size=std::nullopt) &&
Call && body(std::string content, std::string_view contentType) &&
friend class Call
Definition client.hpp:88
Call & body(std::string content, std::string_view contentType) &
Call & body(const T &value) &
Call< Codecs..., C > accept() &&
Definition client.hpp:303
static std::string formatPath(std::string_view path, const std::vector< std::string > ¶meters)
anch::rest::Call request(anch::rest::Method method, std::string_view path, const P &... parameters)
anch::rest::Call head(std::string_view path, const P &... parameters)
anch::rest::Call del(std::string_view path, const P &... parameters)
Client(std::unique_ptr< anch::rest::Transport > transport, std::string_view baseUrl)
Client & filter(anch::rest::Filter filter)
anch::rest::Call get(std::string_view path, const P &... parameters)
anch::rest::Call post(std::string_view path, const P &... parameters)
Client & header(std::string_view name, std::string_view value)
anch::rest::Call patch(std::string_view path, const P &... parameters)
std::string url(const anch::rest::Request &request) const
anch::rest::Response send(anch::rest::Request &request)
anch::rest::Call put(std::string_view path, const P &... parameters)
Definition request.hpp:50
Definition response.hpp:47
Definition paramConverter.hpp:223
AnCH REST library namespace.
Definition auth.hpp:29
Method
Definition method.hpp:36
std::function< anch::rest::Response(anch::rest::Request &, const anch::rest::Next &)> Filter
Definition filter.hpp:36
std::optional< std::uint64_t > size
Definition client.hpp:67
std::string contentType
Definition client.hpp:64
std::unique_ptr< std::istream > input
Definition client.hpp:61