arjuna.tpi.httpauto.request module

class arjuna.tpi.httpauto.request.HttpRequest(session, request, label=None, xcodes=None, strict=False, allow_redirects=True, timeout=None, cookies=None)

Bases: arjuna.tpi.httpauto.message.HttpMessage

Encapsulates HTTP response message.

Parameters:
  • sessionHttpSession object which created this HttpRequest.
  • requestrequests library’s Request object wrapped by this class.
Keyword Arguments:
 
  • label – Label for this request. If available, it is used in Reports and logs.
  • xcodes – Expected Status Code(s)
  • strict – If True in case of unexpected status code, an AssertionError is raised, else HttpUnexpectedStatusCodeError is raised.
  • allow_redirects – If True, redirections are allowed for the HTTP message. Default is True.
  • timeout – How long to wait for the server to send data before giving up.
  • cookies – Cookie dictionary
allow_redirects

True if redirects are allowed for this request.

content

Content of this request message as plain text.

label

Label for this request object.

method

HTTP Method/Verb used by this request.

query_params

URL Query Parameters for this request object.

classmethod repr_as_str(*, method, url, headers, content=None)
strict

True if sending this request should raise an Assertion error in case of unexpected status code.

text

Content of this request message as plain text.

timeout

Timeout for this request.

url

URL correspnding to this request message.

xcodes

Expected status codes for this request.