You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
![]() |
3 years ago | |
---|---|---|
streamedrequests | 4 years ago | |
tests | 4 years ago | |
.gitignore | 4 years ago | |
.travis.yml | 4 years ago | |
CHANGELOG.md | 3 years ago | |
LICENSE | 4 years ago | |
Makefile | 4 years ago | |
Readme.md | 3 years ago | |
requirements.in | 4 years ago | |
requirements.txt | 3 years ago | |
run_tests.sh | 4 years ago | |
setup.py | 3 years ago |
Readme.md
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.