xdevplatform / Twitter-API-v2-sample-code

Sample code for the Twitter API v2 endpoints
https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api
Apache License 2.0
2.66k stars 985 forks source link

Change Python Requests to use "auth=" parameter instead of "headers=" to authenticate the request #41

Closed aureliaspecker closed 3 years ago

aureliaspecker commented 3 years ago

As per the Python Requests documentation

Authorization headers set with headers= will be overridden if credentials are specified in .netrc, which in turn will be overridden by the auth= parameter. Requests will search for the netrc file at ~/.netrc, ~/_netrc, or at the path specified by the NETRC environment variable.

Given the above, I changed all Python files in this repo that use OAuth 2.0 Bearer token to use the "auth=" parameter instead of the "headers=" parameter.

github-actions[bot] commented 3 years ago

CLA Assistant Lite bot All Contributors have signed the CLA. If the commit check is not passing, a maintainer must go the Checks tab of this PR and rerun the GitHub Action.

andypiper commented 3 years ago

recheck

andypiper commented 3 years ago

Recheck

aureliaspecker commented 3 years ago

I have read the CLA Document and I hereby sign the CLA