HTTP Client

django_futures.http_client.py

http_client.py – Asynchronous HTTP Client

This is a ‘smart’ HTTPClient wrapper that also makes requests a bit simpler by borrowing conventions from the ‘requests’ module.

If a tornado IOLoop is running, then async requests are made. Otherwise, tornado’s run_sync() method is used to make the calls synchronous.

class django_futures.http_client.HttpClient(*args, **kwargs)[source]

Bases: object

Docstring for HttpClient

classmethod configure(impl, **kwargs)[source]
get(url, params=None, **kwargs)[source]

GET wrapper. Always returns a future.

Parameters:
  • url (type description) – arg description
  • kwargs (type description) – arg description
Returns:

Return type:

post(url, data=None, params=None, **kwargs)[source]

todo: Docstring for post

Parameters:
  • url (type description) – arg description
  • **kwargs (type description) – arg description
Returns:

Return type:

post_json(url, data, params=None, **kwargs)[source]

todo: Docstring for post_json

Parameters:
  • url (type description) – arg description
  • data (type description) – arg description
  • params (type description) – arg description
  • **kwargs (type description) – arg description
Returns:

Return type: