HTTP Client¶
httpclient
¶
HTTP client protocol definitions and implementations for sync and async requests.
HttpClient
¶
Bases: Protocol
Protocol defining the sync HTTP client interface used by the SDK.
send
¶
Send a request and return a response.
Source code in src/griddy/core/httpclient.py
build_request
¶
build_request(
method,
url,
*,
content=None,
data=None,
files=None,
json=None,
params=None,
headers=None,
cookies=None,
timeout=USE_CLIENT_DEFAULT,
extensions=None,
)
Build an HTTP request object from the given parameters.
Source code in src/griddy/core/httpclient.py
AsyncHttpClient
¶
Bases: Protocol
Protocol defining the async HTTP client interface used by the SDK.
send
async
¶
Send a request asynchronously and return a response.
Source code in src/griddy/core/httpclient.py
build_request
¶
build_request(
method,
url,
*,
content=None,
data=None,
files=None,
json=None,
params=None,
headers=None,
cookies=None,
timeout=USE_CLIENT_DEFAULT,
extensions=None,
)
Build an HTTP request object from the given parameters.
Source code in src/griddy/core/httpclient.py
ClientOwner
¶
Bases: Protocol
Protocol for objects that own sync and async HTTP clients.
close_clients
¶
A finalizer function that is meant to be used with weakref.finalize to close httpx clients used by an SDK so that underlying resources can be garbage collected.