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)¶ A
requests
client that returnsrequests.Response
responses.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)¶ An
aiohttp
client that creates awaitable responses.Note
This client is an optional feature and requires the
aiohttp
package. 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)¶ Client that returns
twisted.internet.defer.Deferred
responses.Note
This client is an optional feature and requires the
twisted
package. 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.