|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
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 *) const > | crt_bundle_attach = {} |
| TLS certificate bundle attach callback. | |
| std::move_only_function< void(const event_data &) const > | on_event = {} |
| Event callback. | |
HTTP client configuration.
Definition at line 110 of file client.hpp.
| enum auth_type idfxx::http::client::config::auth_type = auth_type::none |
Authentication type.
Definition at line 124 of file client.hpp.
| int idfxx::http::client::config::buffer_size = 0 |
Receive buffer size (0 = default)
Definition at line 140 of file client.hpp.
| int idfxx::http::client::config::buffer_size_tx = 0 |
Transmit buffer size (0 = default)
Definition at line 141 of file client.hpp.
| std::string idfxx::http::client::config::cert_pem = {} |
Server CA certificate (PEM)
Definition at line 127 of file client.hpp.
| std::string idfxx::http::client::config::client_cert_pem = {} |
Client certificate (PEM)
Definition at line 128 of file client.hpp.
| std::string idfxx::http::client::config::client_key_pem = {} |
Client private key (PEM)
Definition at line 129 of file client.hpp.
| std::string idfxx::http::client::config::common_name = {} |
Expected server common name.
Definition at line 152 of file client.hpp.
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 automatic redirect following.
Definition at line 135 of file client.hpp.
| std::string idfxx::http::client::config::host = {} |
Host name.
Definition at line 113 of file client.hpp.
| int idfxx::http::client::config::keep_alive_count = 3 |
Keep-alive probe count.
Definition at line 147 of file client.hpp.
Enable TCP keep-alive.
Definition at line 144 of file client.hpp.
| std::chrono::seconds idfxx::http::client::config::keep_alive_idle {5} |
Keep-alive idle time.
Definition at line 145 of file client.hpp.
| std::chrono::seconds idfxx::http::client::config::keep_alive_interval {5} |
Keep-alive probe interval.
Definition at line 146 of file client.hpp.
| int idfxx::http::client::config::max_authorization_retries = 0 |
Maximum auth retries (0 = default)
Definition at line 137 of file client.hpp.
| int idfxx::http::client::config::max_redirection_count = 0 |
Maximum redirects (0 = default)
Definition at line 136 of file client.hpp.
| enum method idfxx::http::client::config::method = method::get |
HTTP method.
Definition at line 117 of file client.hpp.
| 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.
| std::string idfxx::http::client::config::password = {} |
Password for authentication.
Definition at line 123 of file client.hpp.
| std::string idfxx::http::client::config::path = {} |
URL path.
Definition at line 115 of file client.hpp.
| int idfxx::http::client::config::port = 0 |
Port number (0 = default)
Definition at line 114 of file client.hpp.
| std::string idfxx::http::client::config::query = {} |
URL query string.
Definition at line 116 of file client.hpp.
Skip CN verification.
Definition at line 151 of file client.hpp.
| std::chrono::milliseconds idfxx::http::client::config::timeout {5000} |
Request timeout.
Definition at line 119 of file client.hpp.
| enum transport idfxx::http::client::config::transport_type = transport::unknown |
Transport type.
Definition at line 118 of file client.hpp.
| std::string idfxx::http::client::config::url = {} |
Full URL.
Definition at line 112 of file client.hpp.
Use global CA store.
Definition at line 150 of file client.hpp.
| std::string idfxx::http::client::config::user_agent = {} |
Custom User-Agent string.
Definition at line 132 of file client.hpp.
| std::string idfxx::http::client::config::username = {} |
Username for authentication.
Definition at line 122 of file client.hpp.