# requests-raw
[](https://pypi.org/project/requests-raw/)
[](https://pepy.tech/project/requests-raw)

Use [requests](https://requests.readthedocs.io/) to send HTTP raw sockets (To Test RFC Compliance)

## Usage
### Explicit
```python
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)
```python
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+
```sh
pip3 install requests-raw
```
Raw data
{
"_id": null,
"home_page": "https://github.com/realgam3/requests-raw",
"name": "requests-raw",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Tomer Zait (realgam3)",
"author_email": "realgam3@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/5f/5e/e271acacef5b6941de75ae289fa8d57dea20169e81a8f19689cb4acd4b8d/requests-raw-2.0.2.tar.gz",
"platform": "any",
"description": "# requests-raw\n[](https://pypi.org/project/requests-raw/)\n[](https://pepy.tech/project/requests-raw)\n \n\nUse [requests](https://requests.readthedocs.io/) to send HTTP raw sockets (To Test RFC Compliance)\n\n\n\n## Usage\n### Explicit\n```python\nimport json\nimport requests_raw\n\nreq = b\"GET /get HTTP/1.1\\r\\nHost: httpbin.org\\r\\n\\r\\n\"\nres = requests_raw.raw(url='http://httpbin.org/', data=req)\nres_json = res.json()\nprint(json.dumps(res_json, indent=2))\n```\n\n### Implicit (monkey patch)\n```python\nimport json\nimport requests\nimport requests_raw\nrequests_raw.monkey_patch_all()\n\nreq = b\"GET /cookies/set/name/value HTTP/1.1\\r\\nHost: httpbin.org\\r\\n\\r\\n\"\nsession = requests.Session()\nres = session.raw(url='https://httpbin.org/', data=req)\nres_json = res.json()\nprint(json.dumps(res_json, indent=2))\n```\n\n## Installation\n### Prerequisites\n* Python 3.7+\n\n```sh\npip3 install requests-raw\n```\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "HTTP communication through raw sockets using requests for RFC compliance testing",
"version": "2.0.2",
"project_urls": {
"Homepage": "https://github.com/realgam3/requests-raw",
"Source": "https://github.com/realgam3/requests-raw"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "13efea9eb00de5156dc082f1307bca501d64bec5810583be0b8d0e7cf74df656",
"md5": "5f77e504eb7628e2af9cf16a0423f909",
"sha256": "b5fafdaa3a8fe833be306a18a5581d46d65d9a58b6fd25bed3b233e81e5af47a"
},
"downloads": -1,
"filename": "requests_raw-2.0.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "5f77e504eb7628e2af9cf16a0423f909",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 10993,
"upload_time": "2024-01-08T09:32:16",
"upload_time_iso_8601": "2024-01-08T09:32:16.087397Z",
"url": "https://files.pythonhosted.org/packages/13/ef/ea9eb00de5156dc082f1307bca501d64bec5810583be0b8d0e7cf74df656/requests_raw-2.0.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5f5ee271acacef5b6941de75ae289fa8d57dea20169e81a8f19689cb4acd4b8d",
"md5": "bb4205b0d6e0114d35ee67f16a022191",
"sha256": "0524e53439d2272cf9e4d1c51a1919a5d1b43fb66f53168c7d6832f3fbd63a81"
},
"downloads": -1,
"filename": "requests-raw-2.0.2.tar.gz",
"has_sig": false,
"md5_digest": "bb4205b0d6e0114d35ee67f16a022191",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10017,
"upload_time": "2024-01-08T09:32:17",
"upload_time_iso_8601": "2024-01-08T09:32:17.066097Z",
"url": "https://files.pythonhosted.org/packages/5f/5e/e271acacef5b6941de75ae289fa8d57dea20169e81a8f19689cb4acd4b8d/requests-raw-2.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-08 09:32:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "realgam3",
"github_project": "requests-raw",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "requests-raw"
}