Use requests to talk HTTP via a Raw sockets (To Test RFC Compliance)
Project description
requests-raw
Use requests to send HTTP raw sockets (To Test RFC Compliance)
Usage
Explicit
import json
import requests_raw
res = requests_raw.raw(url='http://httpbin.org/', data=b"GET /get HTTP/1.1\r\nHost: httpbin.org\r\n\r\n")
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()
session = requests.Session()
res = session.raw(url='https://httpbin.org/', data=b"GET /cookies/set/name/value HTTP/1.1\r\nHost: httpbin.org\r\n\r\n")
res_json = res.json()
print(json.dumps(res_json, indent=2))
Installation
Prerequisites
- Python 2.7
- Python 3.5+
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-0.2.1.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for requests_raw-0.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0487176d762fa4b6bc54b4219739926fff3bcf0a8f28f78317290315781f4eaf |
|
MD5 | b4928cf2428aa58dbc082bc222d86cc0 |
|
BLAKE2b-256 | 87113f4ac42d8c73f0d7eb0a7602e6b79b1ba14478b2e7844e3966f8546e6bef |