kcurl v0.1.10
Basic C++23 wrapper over libcurl
 
Loading...
Searching...
No Matches
http.hpp File Reference
#include "kcurl/easy.hpp"
#include "kcurl/http_status.hpp"
#include <string_view>

Go to the source code of this file.

Classes

struct  kcurl::http::Query
 
struct  kcurl::http::Error
 Error of a fetch operation. More...
 
struct  kcurl::http::Request
 Input parameter for fetch(). More...
 
struct  kcurl::http::Response< void >
 
struct  kcurl::http::Response< Type >
 Successful response of a fetch operation. Response is a class template to enable user-side reuse for custom payloads (eg JSON). More...
 

Namespaces

namespace  kcurl
 
namespace  kcurl::http
 

Typedefs

template<typename Type >
using kcurl::http::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  kcurl::http::Verb : std::int8_t { kcurl::http::Get , kcurl::http::Post }
 

Functions

auto kcurl::http::escape (std::string_view text) -> std::string
 Replace special characters to be URL-friendly.
 
auto kcurl::http::unescape (std::string_view escaped) -> std::string
 Replace URL escapes with their source characters.
 
auto kcurl::http::to_easy_request (Request request) -> easy::Request
 
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.
 
auto kcurl::http::fetch (Request request) -> Result< ByteArray >
 Primary http API.