fluidasserts.helper.http module

This module provide support for HTTP connections.

exception fluidasserts.helper.http.ConnError

Bases: Exception

A connection error occurred.

requests.ConnectionError wrapper exception.

class fluidasserts.helper.http.HTTPSession(url, params=None, headers=None, method=None, cookies=None, data='', json=None, files=None, auth=None, redirect=True, timeout=10, stream=False)

Bases: object

Class of HTTP request objects.

Construct method.

Parameters
do_request()

Do HTTP request.

Return type

Optional[Response]

formauth_by_response(text)

Authenticate using regex as verification.

Parameters

text (str) – Regex to look for in request response.

Return type

Response

get_fingerprint()

Get HTTP fingerprint.

Return type

dict

Returns

A dict containing the SHA and banner of the host, as per Service.get_fingerprint().

get_html_value(field_type, field_name, field_id='name', field='value', enc=False)

Get a value from an HTML field.

Parameters
  • field_type (str) – Name of HTML tag type to look for, e.g. script.

  • field (Optional[str]) – Name of field, e.g. type.

  • enc (Optional[bool]) – Whether to URL-encode the results.

Return type

str

exception fluidasserts.helper.http.ParameterError

Bases: Exception

A parameter (user input) error occurred.

requests.ConnectionError wrapper exception.