Requests wrapper that add's support for HTTP caching. It act's just like requests but with a few extra parameters and features.
Project description
Urlquick II: Requests, but with caching
Urlquick II
Urlquick2 is a wrapper for requests that add's support for http caching. It act's just like requests but with a few extra parameters and features. 'Requests' itself is left untouched.
All GET, HEAD and POST requests are cached locally for a period of 4 hours, this can be changed. When the cache expires, conditional headers are added to any new request e.g. "Etag" and "Last-modified". Then if the server returns a 304 Not-Modified response, the cache is used, saving having to re-download the content body.
Usage
>>> from urlquick import Session
# Make a connection pool.
>>> http = Session()
# Make a request.
>>> r = http.get('https://httpbin.org/ip')
# View response data.
>>> r.json()
{'ip': '172.69.48.124'}
Install
Stable
$ pip install urlquick
Unstable
$ pip install git+https://github.com/willforde/urlquick.git
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for urlquick-2.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9c451364a2382b17283747e4c1acf81ee33a5e1469325e66c303147843cfbd8 |
|
MD5 | 21cd0c7b39ef9ef4ec8849a5679441b8 |
|
BLAKE2b-256 | f098d7b7438dfcc059459e4f2af551404cbd9a89e18476aeecd1f97e5b6d3bcc |