diff options
author | Jordan Cook <jordan.cook@pioneer.com> | 2021-09-04 16:37:50 -0500 |
---|---|---|
committer | Jordan Cook <jordan.cook@pioneer.com> | 2021-09-04 16:37:50 -0500 |
commit | 2983618943acee411ff58ce4642ff940c9dbff2e (patch) | |
tree | 4b73a1847d3a40dc9e8be778c09ab5bfc37dbb6d /docs | |
parent | 1ef9658c299941c24a391d41a6cff32a7835430f (diff) | |
download | requests-cache-2983618943acee411ff58ce4642ff940c9dbff2e.tar.gz |
Add compatibility example with requests-oauthlib
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user_guide/compatibility.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/user_guide/compatibility.md b/docs/user_guide/compatibility.md index 98d6481..080da9b 100644 --- a/docs/user_guide/compatibility.md +++ b/docs/user_guide/compatibility.md @@ -78,6 +78,19 @@ session = CachedLimiterSession( ) ``` +## Requests-OAuthlib +Usage with [requests-oauthlib](https://github.com/requests/requests-oauthlib) is the same as other +libraries that subclass `requests.Session`: +```python +>>> from requests_cache import CacheMixin +>>> from requests_oauthlib import OAuth2Session + +>>> class CachedOAuth2Session(CacheMixin, OAuth2Session): +... """Session with features from both CachedSession and OAuth2Session""" + +>>> session = CachedOAuth2Session('my_client_id') +``` + ## Internet Archive Usage with [internetarchive](https://github.com/jjjake/internetarchive) is the same as other libraries that subclass `requests.Session`: @@ -87,6 +100,8 @@ that subclass `requests.Session`: >>> class CachedArchiveSession(CacheMixin, ArchiveSession): ... """Session with features from both CachedSession and ArchiveSession""" + +>>> session = CachedArchiveSession() ``` ## Requests-Mock |