Request
Request class used to handle HTTP.
- 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.
- 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.