HTTP communication through raw sockets using requests for RFC compliance testing
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.2.tar.gz
(10.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file requests-raw-2.0.2.tar.gz.
File metadata
- Download URL: requests-raw-2.0.2.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0524e53439d2272cf9e4d1c51a1919a5d1b43fb66f53168c7d6832f3fbd63a81
|
|
| MD5 |
bb4205b0d6e0114d35ee67f16a022191
|
|
| BLAKE2b-256 |
5f5ee271acacef5b6941de75ae289fa8d57dea20169e81a8f19689cb4acd4b8d
|
File details
Details for the file requests_raw-2.0.2-py2.py3-none-any.whl.
File metadata
- Download URL: requests_raw-2.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5fafdaa3a8fe833be306a18a5581d46d65d9a58b6fd25bed3b233e81e5af47a
|
|
| MD5 |
5f77e504eb7628e2af9cf16a0423f909
|
|
| BLAKE2b-256 |
13efea9eb00de5156dc082f1307bca501d64bec5810583be0b8d0e7cf74df656
|