update requests_oauthlib

This commit is contained in:
AdeHub
2024-08-24 16:33:52 +12:00
parent aeebc67365
commit b3edfa0d87
16 changed files with 107 additions and 86 deletions
+5 -10
View File
@@ -1,9 +1,4 @@
from __future__ import unicode_literals
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from urllib.parse import urlparse
import logging
@@ -85,7 +80,7 @@ class OAuth1Session(requests.Session):
'https://api.twitter.com/oauth/authorize?oauth_token=sdf0o9823sjdfsdf&oauth_callback=https%3A%2F%2F127.0.0.1%2Fcallback'
>>>
>>> # Third step. Fetch the access token
>>> redirect_response = raw_input('Paste the full redirect URL here.')
>>> redirect_response = input('Paste the full redirect URL here.')
>>> oauth_session.parse_authorization_response(redirect_response)
{
'oauth_token: 'kjerht2309u',
@@ -258,7 +253,7 @@ class OAuth1Session(requests.Session):
return add_params_to_uri(url, kwargs.items())
def fetch_request_token(self, url, realm=None, **request_kwargs):
r"""Fetch a request token.
"""Fetch a request token.
This is the first step in the OAuth 1 workflow. A request token is
obtained by making a signed post request to url. The token is then
@@ -267,8 +262,8 @@ class OAuth1Session(requests.Session):
:param url: The request token endpoint URL.
:param realm: A list of realms to request access to.
:param \*\*request_kwargs: Optional arguments passed to ''post''
function in ''requests.Session''
:param request_kwargs: Optional arguments passed to ''post''
function in ''requests.Session''
:returns: The response in dict format.
Note that a previously set callback_uri will be reset for your