https://github.com/weaming/requests-dump
Dump requests' http message content to stderr or your custom file
https://github.com/weaming/requests-dump
Last synced: 22 days ago
JSON representation
Dump requests' http message content to stderr or your custom file
- Host: GitHub
- URL: https://github.com/weaming/requests-dump
- Owner: weaming
- Created: 2019-01-14T05:13:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-14T07:24:26.000Z (over 7 years ago)
- Last Synced: 2026-05-01T02:09:59.501Z (2 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Requests Dump
Dump `requests`' http requests message content to stderr or your custom file.
**You may consider use https://toolbelt.readthedocs.io/en/latest/dumputils.html instead**
## Usage
See `test.py`.
### Custom pretty
```
import requests
from requests_dump import pretty_request, pretty_response
req = requests.Request('POST', 'http://ip-api.com/json')
print(pretty_request(req))
res = requests.Session().send(req.prepare())
print(pretty_response(res))
```
## Inspired by
* https://github.com/requests/requests/issues/3013