Client¶
-
class
clients.Client(url, trailing=”, headers=(), **attrs)[source]¶ Bases:
requests.sessions.SessionA Session which sends requests to a base url.
Parameters: - url – base url for requests
- trailing – trailing chars (e.g. /) appended to the url
- headers – additional headers to include in requests
- attrs – additional Session attributes
Resource¶
-
class
clients.Resource(url, trailing=”, headers=(), **attrs)[source]¶ Bases:
clients.syncs.ClientA Client which returns json content and has syntactic support for requests.
-
__delitem__(path=”, **kwargs)¶ DELETE request with optional path.
-
__getitem__(path=”, **kwargs)¶ GET request with optional path.
-
__iter__(path=”, **kwargs)¶ Iterate lines or chunks from streamed GET request.
-
__setitem__(path=”, json=None, **kwargs)¶ PUT request with optional path and json body.
-
AsyncClient¶
-
class
clients.AsyncClient(url, trailing=”, **attrs)[source]¶ Bases:
aiohttp.client.ClientSessionAn asynchronous ClientSession which sends requests to a base url.
Parameters: - url – base url for requests
- trailing – trailing chars (e.g. /) appended to the url
- attrs – additional ClientSession options, e.g., loop
AsyncResource¶
-
class
clients.AsyncResource(url, trailing=”, **attrs)[source]¶ Bases:
clients.asyncs.AsyncClientAn AsyncClient which returns json content and has syntactic support for requests.
-
__call__(path=”, **params)¶ GET request with params.
-
__getitem__(path=”, **kwargs)¶ GET request with optional path.
-
client¶ Upcasted AsyncClient.
-
update(path=”, **json)¶ PATCH request with json params.
-