Created
February 27, 2020 06:49
-
-
Save austincollinpena/09e41690807a2f2614878f88696b16f6 to your computer and use it in GitHub Desktop.
Make a curl request that requires authentication in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numbersJSON = requests.get( | |
# Start with the URL | |
f'https://api.twilio.com/2010-04-01/Accounts/{self._account_sid}/AvailablePhoneNumbers/US/local.json?AreaCode={self.area_code}', | |
# Pass through your credentials like this | |
auth=(self._account_sid, self._auth_token)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment