pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::orch::HttpRequest Struct Reference

An HTTP request. Redirects are never followed, so a credential only goes to url. More...

#include <http.hpp>

Public Member Functions

void add_header (std::string name, std::string value)
 Adds a header.
 
void add_secret_header (std::string name, const Secret &secret)
 Adds a header whose value is secret, marked sensitive.
 
std::string describe () const
 The method, URL and headers, with sensitive values redacted, for logs and errors.
 

Public Attributes

std::string method = "POST"
 
std::string url
 An http:// or https:// URL.
 
std::vector< HttpHeader > headers
 
std::string body
 
std::chrono::milliseconds connect_timeout {10'000}
 The longest the connection (and TLS handshake) may take.
 
std::chrono::milliseconds read_timeout {600'000}
 The longest the server may go without sending a byte. A streamed response can last longer than this in total, as long as it keeps sending.
 
std::size_t max_response_bytes = std::size_t{64} << 20
 The most response body bytes to accept, against a server that never stops.
 

Detailed Description

An HTTP request. Redirects are never followed, so a credential only goes to url.

Member Function Documentation

◆ add_header()

void pulsatrix::orch::HttpRequest::add_header ( std::string  name,
std::string  value 
)

Adds a header.

◆ add_secret_header()

void pulsatrix::orch::HttpRequest::add_secret_header ( std::string  name,
const Secret &  secret 
)

Adds a header whose value is secret, marked sensitive.

◆ describe()

std::string pulsatrix::orch::HttpRequest::describe ( ) const

The method, URL and headers, with sensitive values redacted, for logs and errors.

Member Data Documentation

◆ body

std::string pulsatrix::orch::HttpRequest::body

◆ connect_timeout

std::chrono::milliseconds pulsatrix::orch::HttpRequest::connect_timeout {10'000}

The longest the connection (and TLS handshake) may take.

◆ headers

std::vector<HttpHeader> pulsatrix::orch::HttpRequest::headers

◆ max_response_bytes

std::size_t pulsatrix::orch::HttpRequest::max_response_bytes = std::size_t{64} << 20

The most response body bytes to accept, against a server that never stops.

◆ method

std::string pulsatrix::orch::HttpRequest::method = "POST"

◆ read_timeout

std::chrono::milliseconds pulsatrix::orch::HttpRequest::read_timeout {600'000}

The longest the server may go without sending a byte. A streamed response can last longer than this in total, as long as it keeps sending.

◆ url

std::string pulsatrix::orch::HttpRequest::url

An http:// or https:// URL.


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