python from oauthlib.oauth1 import Client from oauthlib.oauth2 import LegacyApplicationClient, OAuth2Session client = Client('consumer_key', 'consumer_secret') uri, headers, body = client.sign('http://example.com/api/request') client = OAuth2Session('client_id') token = client.fetch_token( 'http://example.com/oauth/token', username='username', password='password', client_id='client_id', client_secret='client_secret' ) response = client.get('http://example.com/api/resource') print(response.content)


上一篇:
下一篇:
切换中文