Response¶
-
class
py42.response.Py42Response(requests_response)¶ Bases:
object-
encoding¶ The encoding used to decode the response text.
-
headers¶ A case-insensitive dictionary of response headers.
-
iter_content(chunk_size=1, decode_unicode=False)¶ Iterates over the response data. When
stream=Trueis set on the request, this avoids reading the content at once into memory for large responses.Parameters: - 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.
-
raw_text¶ The
response.Response.textproperty. It contains raw metadata that is not included in the Py42Response.text property.
-
status_code¶ An integer code of the response HTTP Status, e.g. 404 or 200.
-
text¶ The more useful parts of the HTTP response dumped into a dictionary.
-
url¶ The final URL location of response.
-