The requests
module allows you to send HTTP requests using Python. The HTTP request returns a Response Object with all the response data (content, encoding, status, etc).
SYNTAX : requests.methodname(params)
>>> r = requests.get**(**'<https://api.github.com/user>'**,** auth=**(**'user'**,** 'pass'**))**
>>> r.headers
**[**'content-type'**]**'application/json; charset=utf8'
>>> r.encoding
'utf-8'
>>> r.text
'{"type":"User"...}'
>>> r.json**()**
{'private_gists': 419, 'total_private_repos': 77, ...}
requests.get(url, params=None, **kwargs)
Sends a GET request.Parameters:
• url – URL for the new Request object. • params(optional) - Dictionary, list of tuples or bytes to send in the query string. • **kwargs - (optional) arguments that request takes. • Return type : Response object
Example:
**r = requests.get(url + uri + payload, verify=False, [proxies](<https://p0w3r.notion.site/Proxies-Argument-requests-get-proxies-p-aa15eaad273a4826850927d62dd810b3>)=proxies)**
url = web site,
uri = filter or subpage or option that is vulnerable to sqli attack
<aside> 💡 post and get are very similar functions with their parameters options.
</aside>
requests.**post**
(url, data=None, json=None, **kwargs)[source]
Sends a POST request.Parameters:
• url – URL for the new Request object. • data – (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the Request. • json – (optional) json data to send in the body of the Request. • **kwargs – (optional) arguments that request takes. • Return type : Response object
Session Object requests.Session()