How would I pass parameters to GET request. I have been reading readme file, but can’t figure out how.
Auth Type: Basic
Username: username
Password: password
How would I pass parameters to GET request. I have been reading readme file, but can’t figure out how.
Auth Type: Basic
Username: username
Password: password
Are you using the REQUESTS python library?
requests · PyPI
If so, it can be as simple as this (depending on the authentication method and required response headers):
import requests
r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass'))
print(r.status_code)
# 200
print(r.headers['content-type'])
# 'application/json; charset=utf8'
print(r.encoding)
# 'utf-8'
print(r.text)
# '{"authenticated": true, ...'
print(r.json())
# {'authenticated': True, ...}