Requests wrapper to stream things in chunks, with optional timeout
c76202906f
Bumps [requests](https://github.com/psf/requests) from 2.23.0 to 2.24.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.23.0...v2.24.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> |
||
---|---|---|
streamedrequests | ||
tests | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.md | ||
LICENSE | ||
Makefile | ||
Readme.md | ||
requirements.in | ||
requirements.txt | ||
run_tests.sh | ||
setup.py |
StreamedRequests
Python module to stream HTTP requests in order to ensure content length sanity.
Install
$ pip install StreamedRequests
Basic Usage
from streamedrequests import get, post
def my_func(data):
# prints every 5 bytes of data from site
print(data)
get('https://example.com/', callback=my_func, chunk_size=5)
sync: bool (default True) when set to false creates and starts a new thread for streaming
request_headers param can be used to set req headers
post() is the same, but use post_data to set request body.