python-requests Getting started with python-requests GET requests


requests.get() creates a GET request:

response = requests.get('')

Pass in query parameters as a dictionary to the params argument:

response = requests.get('', params={"a": 1, "b": 2})

For GET requests that might require basic authentication, you can include the auth paramter as follows:

response = requests.get('', auth=('user', 'pass'))