Skip to content

Instantly share code, notes, and snippets.

@vladwa
Last active January 10, 2018 12:41
Show Gist options
  • Save vladwa/f06d2da72f6702f4c87718b302ef5615 to your computer and use it in GitHub Desktop.
Save vladwa/f06d2da72f6702f4c87718b302ef5615 to your computer and use it in GitHub Desktop.
Python snippet to invoke HTTP get request. This function returns Response object.
# 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