Last active
January 10, 2018 12:41
-
-
Save vladwa/f06d2da72f6702f4c87718b302ef5615 to your computer and use it in GitHub Desktop.
Python snippet to invoke HTTP get request. This function returns Response object.
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
# importing the requests library | |
import requests | |
def getResponse(url,header,contentType): | |
"""Sends a getRequest. | |
:param url: URL for the new :class:`Request` object. | |
:return: :class:`Response <Response>` object. | |
""" | |
headers1={'Authorization': headerToken} | |
response = requests.get(url, headers=headers1,timeout=5) | |
return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment