HTTP communication through raw sockets using requests for RFC compliance testing
Reason this release was yanked:
Does not work in some of the versions specified in the setup file
Project description
requests-raw
Use requests to send HTTP raw sockets (To Test RFC Compliance)
Usage
Explicit
import json
import requests_raw
req = b"GET /get HTTP/1.1\r\nHost: httpbin.org\r\n\r\n"
res = requests_raw.raw(url='http://httpbin.org/', data=req)
res_json = res.json()
print(json.dumps(res_json, indent=2))
Implicit (monkey patch)
import json
import requests
import requests_raw
requests_raw.monkey_patch_all()
req = b"GET /cookies/set/name/value HTTP/1.1\r\nHost: httpbin.org\r\n\r\n"
session = requests.Session()
res = session.raw(url='https://httpbin.org/', data=req)
res_json = res.json()
print(json.dumps(res_json, indent=2))
Installation
Prerequisites
- Python 3.7+
pip3 install requests-raw
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
requests-raw-2.0.0.tar.gz
(9.7 kB
view hashes)
Built Distribution
Close
Hashes for requests_raw-2.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc73e5bbac57d1b6a0ce1944a60190e655bc72c6dcf831cdde49d3558b457040 |
|
MD5 | 199aabd31facf75a5fc89767a69cc143 |
|
BLAKE2b-256 | ab6fc5ef87af7e4e215a25fdd5669b80278e1bf9fe2e41915e2316e1d49d8349 |