Synchronous single-request-per-connection client. More...
#include <StormByte/network/http/client.hxx>
Public Member Functions | |
| Client () | |
| Allocate a managed resolver inside Network. | |
| Client (const Client &other)=delete | |
| Copying a resolver owner is disabled. | |
| Client (Client &&other) noexcept | |
| Transfer resolver and immutable TLS policy; moved-from clients can be reassigned but Execute returns InvalidOptions. | |
| ~Client () noexcept | |
| Join retained DNS work and release provider-owned policy. | |
| Client & | operator= (const Client &other)=delete |
| Copy assignment is disabled. | |
| Client & | operator= (Client &&other) noexcept |
| Transfer resolver and policy, joining this client's DNS work. | |
| bool | ConfigureTLS (const Crypto::TLS::ClientConfiguration &configuration, bool refresh_validation_time=true) noexcept |
| Deep-copy custom trust, identity, revocation and mTLS inputs. | |
| bool | ConfigureTLS (const Crypto::TLS::ClientConfiguration &configuration, Safe::String &detail, bool refresh_validation_time=true) |
| Configure TLS with an owned explanation on failure. | |
| Expected< Response, Error > | Execute (const Request &request, const Options &options={}) |
| Execute one bounded request, closing its connection on all exits. | |
| Expected< Response, Error > | Execute (const Request &request, const Options &options, Safe::String &detail) |
| Execute with an owned TLS failure explanation. | |
Synchronous single-request-per-connection client.
No pooling, redirects, decompression, retries, proxy or server. Serialize Execute, ConfigureTLS, moves and destruction externally. Its managed resolver retains at most one DNS worker after timeout; subsequent calls may return ResolverBusy. Destruction joins that worker and can wait for the OS resolver independently of request deadlines. Network, Crypto, Base and logger providers must stay loaded until release.
| StormByte::Network::HTTP::Client::Client | ( | ) |
Allocate a managed resolver inside Network.
| StormByte::Safe::AllocationError | Resolver ownership cannot be allocated. |
|
delete |
Copying a resolver owner is disabled.
| other | Source client. |
|
noexcept |
Transfer resolver and immutable TLS policy; moved-from clients can be reassigned but Execute returns InvalidOptions.
| other | Source client. |
|
noexcept |
Join retained DNS work and release provider-owned policy.
|
noexcept |
Deep-copy custom trust, identity, revocation and mTLS inputs.
ALPN is controlled by HTTP Options, not the supplied alpn_wire. Failed configuration leaves the prior policy unchanged.
| configuration | Synchronously borrowed Crypto inputs. |
| refresh_validation_time | Default true validates at each new session; false explicitly opts into the supplied fixed validation time. |
| bool StormByte::Network::HTTP::Client::ConfigureTLS | ( | const Crypto::TLS::ClientConfiguration & | configuration, |
| Safe::String & | detail, | ||
| bool | refresh_validation_time = true ) |
Configure TLS with an owned explanation on failure.
| configuration | Borrowed Crypto inputs. |
| detail | Output cleared on entry; copied category or allocation explanation on failure. |
| refresh_validation_time | Refresh validation time per session. |
| StormByte::Safe::AllocationError | Explanation storage cannot be allocated. |
| Expected< Response, Error > StormByte::Network::HTTP::Client::Execute | ( | const Request & | request, |
| const Options & | options, | ||
| Safe::String & | detail ) |
Execute with an owned TLS failure explanation.
| request | Borrowed request. |
| options | Total deadline, protocol and buffer bounds. |
| detail | Output cleared on entry; populated for TLS failures and unnotified TLS EOF. |
| StormByte::Safe::AllocationError | Result or explanation storage cannot be allocated. |
The output survives session destruction. Non-TLS errors leave it empty. No class layout or error-enumeration changes are required.
| Expected< Response, Error > StormByte::Network::HTTP::Client::Execute | ( | const Request & | request, |
| const Options & | options = {} ) |
Execute one bounded request, closing its connection on all exits.
Default HTTPS verifies URL identity with bundled Crypto roots. Explicit identity configuration instead verifies that configured identity.
| request | Synchronously borrowed immutable request. |
| options | Total deadline, protocol and buffer bounds. |
| StormByte::Safe::AllocationError | Error storage cannot be allocated. |
Transfer resolver and policy, joining this client's DNS work.
| other | Source client. |
Copy assignment is disabled.
| other | Source client. |