class documentation

class HTTPClient: (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method delete See :func:`treq.delete()`.
Method get See :func:`treq.get()`.
Method head See :func:`treq.head()`.
Method patch See :func:`treq.patch()`.
Method post See :func:`treq.post()`.
Method put See :func:`treq.put()`.
Method request See :func:`treq.request()`.
Method _request_body Here we choose a right producer based on the parameters passed in.
Method _request_headers Convert the *headers* argument to a :class:`Headers` instance
Instance Variable _agent Undocumented
Instance Variable _cookiejar Undocumented
Instance Variable _data_to_body_producer Undocumented
def __init__(self, agent, cookiejar=None, data_to_body_producer=IBodyProducer): (source)

Undocumented

def delete(self, url, **kwargs): (source)

See :func:`treq.delete()`.

def get(self, url, **kwargs): (source)

See :func:`treq.get()`.

def head(self, url, **kwargs): (source)

See :func:`treq.head()`.

def patch(self, url, data=None, **kwargs): (source)

See :func:`treq.patch()`.

def post(self, url, data=None, **kwargs): (source)

See :func:`treq.post()`.

def put(self, url, data=None, **kwargs): (source)

See :func:`treq.put()`.

def request(self, method, url, *, params=None, headers=None, data=None, files=None, json=_NOTHING, auth=None, cookies=None, allow_redirects=True, browser_like_redirects=False, unbuffered=False, reactor=None, timeout=None, _stacklevel=2): (source)

See :func:`treq.request()`.

def _request_body(self, data, files, json, stacklevel): (source)

Here we choose a right producer based on the parameters passed in. :params data: Arbitrary request body data. If *files* is also passed this must be a :class:`dict`, a :class:`tuple` or :class:`list` of field tuples as accepted by :class:`MultiPartProducer`. The request is assigned a Content-Type of ``multipart/form-data``. If a :class:`dict`, :class:`list`, or :class:`tuple` it is URL-encoded and the request assigned a Content-Type of ``application/x-www-form-urlencoded``. Otherwise, any non-``None`` value is passed to the client's *data_to_body_producer* callable (by default, :class:`IBodyProducer`), which accepts file-like objects. :params files: Files to include in the request body, in any of the several formats described in :func:`_convert_files()`. :params json: JSON-encodable data, or the sentinel `_NOTHING`. The sentinel is necessary because ``None`` is a valid JSON value.

def _request_headers(self, headers, stacklevel): (source)

Convert the *headers* argument to a :class:`Headers` instance :returns: :class:`twisted.web.http_headers.Headers`

_agent = (source)

Undocumented

_cookiejar = (source)

Undocumented

_data_to_body_producer = (source)

Undocumented