Created
March 23, 2017 23:31
-
-
Save krvajal/df4397e5667c13d25f642a1a65a2925c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Install the Python Requests library: | |
# `pip install requests` | |
import requests | |
def send_request(): | |
# My API | |
# GET https://api.invertironline.com/api/micuenta/estadocuenta | |
try: | |
response = requests.get( | |
url="https://api.invertironline.com/api/micuenta/estadocuenta", | |
headers={ | |
"Authorization": "Basic YWNvbGxhZG8xOTkyOioqKioqIEhpZGRlbiBjcmVkZW50aWFscyAqKioqKg==", | |
}, | |
) | |
print('Response HTTP Status Code: {status_code}'.format( | |
status_code=response.status_code)) | |
print('Response HTTP Response Body: {content}'.format( | |
content=response.content)) | |
except requests.exceptions.RequestException: | |
print('HTTP Request failed') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment