idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::http::client::config Struct Reference

HTTP client configuration. More...

#include <idfxx_http_client/include/idfxx/http/client.hpp>

Public Attributes

std::string url = {}
 Full URL.
 
std::string host = {}
 Host name.
 
int port = 0
 Port number (0 = default)
 
std::string path = {}
 URL path.
 
std::string query = {}
 URL query string.
 
enum method method = method::get
 HTTP method.
 
enum transport transport_type = transport::unknown
 Transport type.
 
std::chrono::milliseconds timeout {5000}
 Request timeout.
 
std::string username = {}
 Username for authentication.
 
std::string password = {}
 Password for authentication.
 
enum auth_type auth_type = auth_type::none
 Authentication type.
 
std::string cert_pem = {}
 Server CA certificate (PEM)
 
std::string client_cert_pem = {}
 Client certificate (PEM)
 
std::string client_key_pem = {}
 Client private key (PEM)
 
std::string user_agent = {}
 Custom User-Agent string.
 
bool disable_auto_redirect = false
 Disable automatic redirect following.
 
int max_redirection_count = 0
 Maximum redirects (0 = default)
 
int max_authorization_retries = 0
 Maximum auth retries (0 = default)
 
int buffer_size = 0
 Receive buffer size (0 = default)
 
int buffer_size_tx = 0
 Transmit buffer size (0 = default)
 
bool keep_alive_enable = false
 Enable TCP keep-alive.
 
std::chrono::seconds keep_alive_idle {5}
 Keep-alive idle time.
 
std::chrono::seconds keep_alive_interval {5}
 Keep-alive probe interval.
 
int keep_alive_count = 3
 Keep-alive probe count.
 
bool use_global_ca_store = false
 Use global CA store.
 
bool skip_cert_common_name_check = false
 Skip CN verification.
 
std::string common_name = {}
 Expected server common name.
 
std::move_only_function< int(void *) constcrt_bundle_attach = {}
 TLS certificate bundle attach callback.
 
std::move_only_function< void(const event_data &) conston_event = {}
 Event callback.
 

Detailed Description

HTTP client configuration.

Definition at line 110 of file client.hpp.

Member Data Documentation

◆ auth_type

enum auth_type idfxx::http::client::config::auth_type = auth_type::none

Authentication type.

Definition at line 124 of file client.hpp.

◆ buffer_size

int idfxx::http::client::config::buffer_size = 0

Receive buffer size (0 = default)

Definition at line 140 of file client.hpp.

◆ buffer_size_tx

int idfxx::http::client::config::buffer_size_tx = 0

Transmit buffer size (0 = default)

Definition at line 141 of file client.hpp.

◆ cert_pem

std::string idfxx::http::client::config::cert_pem = {}

Server CA certificate (PEM)

Definition at line 127 of file client.hpp.

◆ client_cert_pem

std::string idfxx::http::client::config::client_cert_pem = {}

Client certificate (PEM)

Definition at line 128 of file client.hpp.

◆ client_key_pem

std::string idfxx::http::client::config::client_key_pem = {}

Client private key (PEM)

Definition at line 129 of file client.hpp.

◆ common_name

std::string idfxx::http::client::config::common_name = {}

Expected server common name.

Definition at line 152 of file client.hpp.

◆ crt_bundle_attach

std::move_only_function<int(void*) const> idfxx::http::client::config::crt_bundle_attach = {}

TLS certificate bundle attach callback.

Called during the TLS handshake to attach a certificate bundle to the underlying TLS configuration. The parameter is an opaque pointer to the TLS configuration (e.g. mbedtls_ssl_config). Returns 0 on success or a non-zero error code on failure.

Typically set to esp_crt_bundle_attach from the ESP-IDF certificate bundle component.

Definition at line 164 of file client.hpp.

◆ disable_auto_redirect

bool idfxx::http::client::config::disable_auto_redirect = false

Disable automatic redirect following.

Definition at line 135 of file client.hpp.

◆ host

std::string idfxx::http::client::config::host = {}

Host name.

Definition at line 113 of file client.hpp.

◆ keep_alive_count

int idfxx::http::client::config::keep_alive_count = 3

Keep-alive probe count.

Definition at line 147 of file client.hpp.

◆ keep_alive_enable

bool idfxx::http::client::config::keep_alive_enable = false

Enable TCP keep-alive.

Definition at line 144 of file client.hpp.

◆ keep_alive_idle

std::chrono::seconds idfxx::http::client::config::keep_alive_idle {5}

Keep-alive idle time.

Definition at line 145 of file client.hpp.

◆ keep_alive_interval

std::chrono::seconds idfxx::http::client::config::keep_alive_interval {5}

Keep-alive probe interval.

Definition at line 146 of file client.hpp.

◆ max_authorization_retries

int idfxx::http::client::config::max_authorization_retries = 0

Maximum auth retries (0 = default)

Definition at line 137 of file client.hpp.

◆ max_redirection_count

int idfxx::http::client::config::max_redirection_count = 0

Maximum redirects (0 = default)

Definition at line 136 of file client.hpp.

◆ method

enum method idfxx::http::client::config::method = method::get

HTTP method.

Definition at line 117 of file client.hpp.

◆ on_event

std::move_only_function<void(const event_data&) const> idfxx::http::client::config::on_event = {}

Event callback.

Definition at line 167 of file client.hpp.

◆ password

std::string idfxx::http::client::config::password = {}

Password for authentication.

Definition at line 123 of file client.hpp.

◆ path

std::string idfxx::http::client::config::path = {}

URL path.

Definition at line 115 of file client.hpp.

◆ port

int idfxx::http::client::config::port = 0

Port number (0 = default)

Definition at line 114 of file client.hpp.

◆ query

std::string idfxx::http::client::config::query = {}

URL query string.

Definition at line 116 of file client.hpp.

◆ skip_cert_common_name_check

bool idfxx::http::client::config::skip_cert_common_name_check = false

Skip CN verification.

Definition at line 151 of file client.hpp.

◆ timeout

std::chrono::milliseconds idfxx::http::client::config::timeout {5000}

Request timeout.

Definition at line 119 of file client.hpp.

◆ transport_type

enum transport idfxx::http::client::config::transport_type = transport::unknown

Transport type.

Definition at line 118 of file client.hpp.

◆ url

std::string idfxx::http::client::config::url = {}

Full URL.

Definition at line 112 of file client.hpp.

◆ use_global_ca_store

bool idfxx::http::client::config::use_global_ca_store = false

Use global CA store.

Definition at line 150 of file client.hpp.

◆ user_agent

std::string idfxx::http::client::config::user_agent = {}

Custom User-Agent string.

Definition at line 132 of file client.hpp.

◆ username

std::string idfxx::http::client::config::username = {}

Username for authentication.

Definition at line 122 of file client.hpp.


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