HTTP Clients¶
The client parameter of the Consumer constructor offers a way
to swap out Requests with another HTTP client, including those listed here:
github = GitHub(BASE_URL, client=...)
Requests¶
-
class
uplink.RequestsClient(session=None, **kwargs)[source]¶ A
requestsclient that returnsrequests.Responseresponses.Parameters: session ( requests.Session, optional) – The session that should handle sending requests. If this argument is omitted or set toNone, a new session will be created.
Aiohttp¶
-
class
uplink.AiohttpClient(session=None, **kwargs)[source]¶ An
aiohttpclient that creates awaitable responses.Note
This client is an optional feature and requires the
aiohttppackage. For example, here’s how to install this extra using pip:$ pip install uplink[aiohttp]
Parameters: session ( aiohttp.ClientSession, optional) – The session that should handle sending requests. If this argument is omitted or set toNone, a new session will be created.
Twisted¶
-
class
uplink.TwistedClient(session=None)[source]¶ Client that returns
twisted.internet.defer.Deferredresponses.Note
This client is an optional feature and requires the
twistedpackage. For example, here’s how to install this extra using pip:$ pip install uplink[twisted]
Parameters: session ( requests.Session, optional) – The session that should handle sending requests. If this argument is omitted or set toNone, a new session will be created.