Request

Request class used to handle HTTP.

prompt_empty_key(element, name)[source]
prompt_empty_value(element, name)[source]
get_empty_plugin_name(plugin)[source]
get_empty_plugin_value(plugin, name)[source]
process_cookies(raw_cookies, pconfig)[source]

Process the raw cookies and replace with the real data.

Return type

Dict[str, str]

process_headers(raw_headers, pconfig)[source]

Process the raw headers and replace with the real data.

Return type

Dict[str, str]

process_data(raw_data, pconfig)[source]

Process the raw HTTP data and replace with the real data.

Return type

Dict[str, str]

class Request(function, url, method, **kwargs)[source]

Class holding the elements of the HTTP request.

When a Flow object is created, it defines a Request object with the information necessary to create a HTTP request. The “method” and “url” attributes are required. Everything else is optional.

The Request object can contain Plugins which will be evaluated and its value replaced in the HTTP request.

method

A string with the HTTP request method. Only GET and POST is supported for now.

url

A string with the URL of the HTTP request.

cookies

A list of Cookie objects to be sent with the HTTP request.

headers

A list of Header objects to be sent with the HTTP request.

data

A dictionary of Any objects. Can contain strings and Plugins. When a key or a value of the dictionary is a Plugin, it will be evaluated and its value will be used in the HTTP request. If the “method” is GET those values will be put inside the URL parameters, and if the “method” is POST they will be inside the POST request body.

__init__(function, url, method, **kwargs)[source]

Initializes the Request object.

classmethod get(url, **kwargs)[source]
Return type

Request

classmethod post(url, **kwargs)[source]
Return type

Request

classmethod put(url, **kwargs)[source]
Return type

Request

classmethod patch(url, **kwargs)[source]
Return type

Request

classmethod head(url, **kwargs)[source]
Return type

Request

classmethod delete(url, **kwargs)[source]
Return type

Request

classmethod connect(url, **kwargs)[source]
Return type

Request

classmethod options(url, **kwargs)[source]
Return type

Request

classmethod trace(url, **kwargs)[source]
Return type

Request

classmethod custom(method, url, **kwargs)[source]
Return type

Request

list_inputs()[source]

Returns a list of request’s inputs.

Return type

Optional[Dict[str, Plugin]]

send(pconfig)[source]

Sends the HTTP request.

With the given user information, replaces the input plugins with their values, and sends the HTTP request. Returns the response.

Parameters
  • user – A User object with the user specific data to be used when processing inputs.

  • pconfig – A Config object with the global Raider configuration.

Return type

Optional[Response]

Returns

A requests.models.Response object with the HTTP response received after sending the generated request.

class Template(method, url=None, cookies=None, headers=None, data=None)[source]

Template class to hold requests.

It will initiate itself with a Request parent, and when called will return a copy of itself with the modified parameters.

__init__(method, url=None, cookies=None, headers=None, data=None)[source]

Initializes the template object.

__call__(method=None, url=None, cookies=None, headers=None, data=None)[source]

Allow the object to be called.

Accepts the same arguments as the Request class. When called, will return a copy of itself with the modified parameters.

Return type

Template