50template <
typename Type>
63template <
typename Type>
86template <
typename Type>
92[[nodiscard]]
auto escape(std::string_view text) -> std::string;
96[[nodiscard]]
auto unescape(std::string_view escaped) -> std::string;
Wrapper over a response status code.
Definition http_status.hpp:7
auto to_easy_request(Request request) -> easy::Request
auto perform(easy::Request const &request) -> Result< ByteArray >
Perform easy::Request and interpret the easy::Result as an http::Result. This lower-level function is...
auto fetch(Request request) -> Result< ByteArray >
Primary http API.
Definition http.hpp:114
auto unescape(std::string_view escaped) -> std::string
Replace URL escapes with their source characters.
std::expected< Response< Type >, Error > Result
Result of a fetch operation. Result is a class template to enable user-side reuse for custom Reponse ...
Definition http.hpp:87
Verb
Definition http.hpp:7
auto escape(std::string_view text) -> std::string
Replace special characters to be URL-friendly.
CurlCode
Definition curl_code.hpp:6
Input parameter for perform().
Definition easy.hpp:18
Flag
Definition easy.hpp:19
Error of a fetch operation.
Definition http.hpp:15
Status status
Definition http.hpp:22
CurlCode curl_code
Definition http.hpp:21
std::string text
Definition http.hpp:23
static auto from_response(Status status, std::string_view error_text) -> Error
std::string value
Definition http.hpp:11
std::string key
Definition http.hpp:10
Input parameter for fetch().
Definition http.hpp:27
Verb verb
Request method.
Definition http.hpp:42
std::vector< Query > headers
List of HTTP header queries, if any. Suffix a key with ':' to remove that default header.
Definition http.hpp:40
std::string base_url
URL to fetch. Must be a valid URL.
Definition http.hpp:31
Flag flags
Request flags.
Definition http.hpp:44
std::vector< Query > queries
List of HTTP queries, if any. Appended to base_url if verb == Verb::Get, else added as post fields.
Definition http.hpp:37
std::string user_agent
User agent to use, if any.
Definition http.hpp:34
auto rewrap_as_error(std::string_view const error_text) const -> Error
Definition http.hpp:56
Successful response of a fetch operation. Response is a class template to enable user-side reuse for ...
Definition http.hpp:64
auto rewrap_as_error(std::string_view const error_text) const -> Error
Definition http.hpp:75
Type payload
Definition http.hpp:79
Status status
Definition http.hpp:80
auto rewrap_as(T payload) const -> Response< T >
Definition http.hpp:67
auto rewrap_as_void() const -> Response< void >
Definition http.hpp:72