Classes | |
| struct | Error |
| Error of a fetch operation. More... | |
| struct | Query |
| struct | Request |
| Input parameter for fetch(). More... | |
| struct | Response |
| Successful response of a fetch operation. Response is a class template to enable user-side reuse for custom payloads (eg JSON). More... | |
| struct | Response< void > |
| class | Status |
| Wrapper over a response status code. More... | |
Typedefs | |
| template<typename Type > | |
| using | Result = std::expected< Response< Type >, Error > |
| Result of a fetch operation. Result is a class template to enable user-side reuse for custom Reponse payloads (eg JSON). | |
Enumerations | |
| enum class | Verb : std::int8_t { Get , Post } |
Functions | |
| auto | escape (std::string_view text) -> std::string |
| Replace special characters to be URL-friendly. | |
| auto | unescape (std::string_view escaped) -> std::string |
| Replace URL escapes with their source characters. | |
| 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 exposed primarily for users to customize some behavior after the conversion of an http::Request to an easy::Request in the process of fetching the Response. If that is not required, use fetch() directly. | |
| auto | fetch (Request request) -> Result< ByteArray > |
| Primary http API. | |
| using kcurl::http::Result = typedef std::expected<Response<Type>, Error> |
Result of a fetch operation. Result is a class template to enable user-side reuse for custom Reponse payloads (eg JSON).
|
strong |
| auto kcurl::http::escape | ( | std::string_view | text | ) | -> std::string |
Replace special characters to be URL-friendly.
| text | Input (unescaped) text. |
Primary http API.
| request | http::Request to fetch. |
| auto kcurl::http::perform | ( | easy::Request const & | request | ) | -> Result< ByteArray > |
Perform easy::Request and interpret the easy::Result as an http::Result. This lower-level function is exposed primarily for users to customize some behavior after the conversion of an http::Request to an easy::Request in the process of fetching the Response. If that is not required, use fetch() directly.
| request | easy::Request to perform. |
| auto kcurl::http::to_easy_request | ( | Request | request | ) | -> easy::Request |
| request | http Request to convert. |
| auto kcurl::http::unescape | ( | std::string_view | escaped | ) | -> std::string |
Replace URL escapes with their source characters.
| escaped | Escaped string. |