74 [[nodiscard]] std::optional<std::string>
header(std::string_view name)
const;
147 std::unique_ptr<Impl> impl_;
151[[nodiscard]] NEURALPLUS_API std::shared_ptr<HttpTransport>
170 [[nodiscard]] std::vector<HttpRequest>
requests()
const;
180 mutable std::mutex mutex_;
181 std::vector<HttpRequest> requests_;
Definition transport.hpp:133
HttpResponse send(const HttpRequest &request) override
Sends one request synchronously through libcurl.
CurlHttpTransport(HttpTransportOptions options={})
Creates a libcurl transport with the supplied connection settings.
Definition transport.hpp:81
virtual HttpResponse send(const HttpRequest &request)=0
Sends one complete request and returns its HTTP response.
Deterministic callback transport that also records requests for tests.
Definition transport.hpp:155
std::vector< HttpRequest > requests() const
Returns a thread-safe snapshot of recorded requests.
HttpResponse send(const HttpRequest &request) override
Records the request and delegates response creation to the handler.
MockHttpTransport(Handler handler)
Creates a recording transport backed by handler.
std::function< HttpResponse(const HttpRequest &)> Handler
Definition transport.hpp:160
void clear_requests()
Removes all recorded requests.
Provider-independent HTTP request.
Definition transport.hpp:45
std::string body
Serialized request body.
Definition transport.hpp:56
std::string url
Absolute request URL.
Definition transport.hpp:50
std::chrono::milliseconds timeout
Complete request timeout.
Definition transport.hpp:59
HttpMethod method
Request method.
Definition transport.hpp:47
std::vector< HttpHeader > headers
Request headers, including provider authentication.
Definition transport.hpp:53
Provider-independent HTTP response.
Definition transport.hpp:63
std::vector< HttpHeader > headers
Response headers.
Definition transport.hpp:68
std::optional< std::string > header(std::string_view name) const
Finds a header using case-insensitive ASCII comparison.
std::string body
Raw response body.
Definition transport.hpp:71
Settings for the built-in libcurl transport.
Definition transport.hpp:97
std::string user_agent
HTTP User-Agent sent by the built-in transport.
Definition transport.hpp:108
std::chrono::milliseconds connect_timeout
TCP/TLS connection timeout.
Definition transport.hpp:99
bool verify_tls
Enables peer and host certificate verification.
Definition transport.hpp:102
std::string proxy
Optional libcurl proxy URL; cleartext loopback URLs always bypass it.
Definition transport.hpp:105
std::size_t max_response_header_bytes
Maximum aggregate response-header bytes accepted from a provider.
Definition transport.hpp:114
std::size_t max_response_body_bytes
Maximum response-body bytes accepted from a provider.
Definition transport.hpp:111
NEURALPLUS_API std::shared_ptr< HttpTransport > make_default_http_transport(HttpTransportOptions options={})
Returns the built-in production HTTP transport.
HttpMethod
HTTP method used by provider adapters.
Definition transport.hpp:24