Requests Flashcards
1
Q
Request
Post
A
data = {'example': 'json'} headers = {'User-Agent': 'Chrome'} requests.post(url, data=data, headers=headers)
2
Q
Requests
Get
A
requests.get(url, headers=headers)
3
Q
Requests
Get Status
A
response.status_code
4
Q
Requests
Convert Response to Json
A
data = response.json()
5
Q
Requests
Get amount of time from response
A
response.elapsed.total_seconds()
6
Q
Requests
Get html or text of response
A
response.text
7
Q
Requests
Get a specific header
A
response.headers['HeaderName']
8
Q
Requests
Good Numeric values to API test
A
-1, 0, long number, fractions, 2 decimals points, string instead of int, missing variable, wrong method