summaryrefslogtreecommitdiff
path: root/requests_cache/response.py
Commit message (Collapse)AuthorAgeFilesLines
* Read manually instead of using _body, move decode tests to integration testsshiftinv2021-04-181-5/+5
|
* Improve raw response reset, update testsshiftinv2021-04-181-28/+18
|
* Fix handling of decode_content parameter for raw.read(...)shiftinv2021-04-181-10/+29
|
* Demote most logging.info statements to debugJordan Cook2021-04-101-1/+1
|
* Improvements to Sphinx documentation:Jordan Cook2021-04-031-0/+1
| | | | | | | | | | | | | | * Use sphinx-apidoc to auto-generate sources for backend modules * Still manually adding other modules for more control over formatting * Add a couple more contributors I missed * Include contributors on readthedocs * Add 'all' Makefile target and clean auto-generated docs * Remove unused build targets in Makefile * Update interpshinx links that have moved * Fix some interpshinx links * Fix some `:ref:` links using auto-generated labels (and some manually added labels where convenient) * Fix some docstring formatting * Fix remaining build warnings
* Add example script to convert an existing cache from previous serialization ↵Jordan Cook2021-04-031-1/+2
| | | | format to new one
* Avoid recursion when caching redirectsJordan Cook2021-03-311-3/+4
|
* Add logging to main cache operationsJordan Cook2021-03-301-3/+7
|
* Consolidate expiration, pre-serializiation, and other response object logic ↵Jordan Cook2021-03-221-0/+156
into CachedResponse class: * Replace `_RawStore` with `CachedHTTPResponse` class to wrap raw responses * Maintain support for streaming requests (#68) * Improve handling for generator usage * Add support for use with `pandas.read_csv()` and similar readers (#148) * Add support for use as a context manager (#148) * Add support for `decode_content` arg * Fix streaming requests when used with memory backend (#188) * Verified that `PreparedRequest.body` is always encoded in utf-8, so no need to detect encoding (Re: TODO note) * Response creation time and expiration time are stored as CachedResponse, so the `(response, timestamp)` tuple is no longer necessary * Rename `response.expire_after` and `response.cache_date` to `expires` and `created_at`, respectively, based on browser cache directives * Add optional `expire_after` param to `CachedSession.remove_old_responses()` * Make `CachedSession` members `allowable_codes, allowable_methods, filter_fn, old_data_on_error` public, since they can safely be modified after initialization * More type annotations and docstring updates * Move main cache documentation from `CacheMixin` to CachedSession`, since that's probably where a user would look first * Wrap temporary `_request_expire_after` in a contextmanager * Add intersphinx links for `urllib` classes & methods * Fix linting issues raised by flake8 * Start adding some unit tests using requests-mock tmp