class py42.response.Py42Response(requests_response)

Bases: object


The encoding used to decode the response text.


A case-insensitive dictionary of response headers.

iter_content(chunk_size=1, decode_unicode=False)

Iterates over the response data. When stream=True is set on the request, this avoids reading the content at once into memory for large responses.

  • chunk_size (int, optional) – The number of bytes it should read into memory. A value of None will function differently depending on the value of stream. stream=True will read data as it arrives in whatever size the chunks are received. If stream=False, data is returned as a single chunk. This is not necessarily the length of each item. Defaults to 1.
  • decode_unicode (bool, optional) – If True, content will be decoded using the best available encoding based on the response. Defaults to False.

The response.Response.text property. It contains raw metadata that is not included in the Py42Response.text property.


An integer code of the response HTTP Status, e.g. 404 or 200.


The more useful parts of the HTTP response dumped into a dictionary.


The final URL location of response.