Transport¶
Transport ¶
Bases: ABC
Protocol / base class for HTTP transports.
Implementations must be reusable across multiple requests.
Source code in merchants/transport.py
Functions¶
send
abstractmethod
¶
send(
method: str,
url: str,
*,
headers: dict[str, str] | None = None,
json: Any = None,
params: dict[str, str] | None = None,
timeout: float = 30.0,
) -> HttpResponse
Send an HTTP request and return an :class:HttpResponse.
Raises:
| Type | Description |
|---|---|
TransportError
|
On network or connection failure. |
Source code in merchants/transport.py
HttpResponse ¶
Thin wrapper around an HTTP response.
Source code in merchants/transport.py
RequestsTransport ¶
Bases: Transport
Default transport backed by :mod:requests.
A single :class:requests.Session is reused for connection pooling.