kaycxx-http
HTTP client library
Loading...
Searching...
No Matches
kaycxx::http::request_options Struct Reference

Optional HTTP request configuration. More...

#include <kaycxx/http/request_options.hpp>

Public Attributes

std::vector< headerheaders {}
 Request headers.
std::optional< bool > follow_redirects {}
 Whether HTTP redirects are followed.
std::optional< std::size_t > max_redirects {}
 Maximum number of redirects to follow.
std::optional< std::chrono::milliseconds > connect_timeout {}
 Maximum duration of the connection phase.
std::optional< std::chrono::milliseconds > request_timeout {}
 Maximum duration of the complete request.
std::function< void(const transfer_progress &)> progress {}
 Callback receiving transfer progress.
std::optional< std::size_t > max_buffered_response_size {}
 Maximum size of an internally buffered response body.

Detailed Description

Optional HTTP request configuration.

Options passed to a request override the corresponding defaults configured on its client. Unset options inherit the client value or, when the client also leaves them unset, the library or libcurl default.

Member Data Documentation

◆ connect_timeout

std::optional<std::chrono::milliseconds> kaycxx::http::request_options::connect_timeout {}

Maximum duration of the connection phase.

std::nullopt inherits the client setting.

◆ follow_redirects

std::optional<bool> kaycxx::http::request_options::follow_redirects {}

Whether HTTP redirects are followed.

std::nullopt inherits the client setting.

◆ headers

std::vector<header> kaycxx::http::request_options::headers {}

Request headers.

Content-Length and Transfer-Encoding are managed by the client. Multipart requests also manage their outer Content-Type. Request-specific headers replace client headers with the same ASCII case-insensitive name and retain all other client headers.

◆ max_buffered_response_size

std::optional<std::size_t> kaycxx::http::request_options::max_buffered_response_size {}

Maximum size of an internally buffered response body.

std::nullopt inherits the client setting and zero disables the limit.

◆ max_redirects

std::optional<std::size_t> kaycxx::http::request_options::max_redirects {}

Maximum number of redirects to follow.

std::nullopt inherits the client setting.

◆ progress

std::function<void(const transfer_progress&)> kaycxx::http::request_options::progress {}

Callback receiving transfer progress.

An empty function inherits the client callback.

◆ request_timeout

std::optional<std::chrono::milliseconds> kaycxx::http::request_options::request_timeout {}

Maximum duration of the complete request.

std::nullopt inherits the client setting.


The documentation for this struct was generated from the following file: