Skip to main content

Module http_client

Module http_client 

Source
Expand description

The HTTP layer of the client.

The HttpBackend trait defines the minimal contract for sending a single HTTP request and receiving a response. It is the replaceable component of the client: the default implementation ReqwestBackend uses reqwest, but a custom backend (e.g. for testing or for a different runtime) can be plugged in via ApifyClientBuilder::http_backend.

HttpClient wraps a backend and adds the cross-cutting concerns shared by every endpoint: authentication, the User-Agent header, query-parameter serialization, timeouts and retries with exponential backoff (mirroring the JavaScript and Python reference clients).

Structs§

HttpClient
The orchestrating HTTP client shared by every resource client.
HttpRequest
A fully-resolved HTTP request, ready to be sent by an HttpBackend.
HttpResponse
An HTTP response returned by an HttpBackend.
ReqwestBackend
The default HttpBackend implementation, backed by reqwest.
RetryConfig
Configuration for the retry/timeout behaviour of the HttpClient.

Enums§

HttpMethod
HTTP method of a request.

Traits§

HttpBackend
The replaceable transport contract.