Answers for "response code python"

6

python print return code of requests

>>> import requests
>>> r = requests.get('http://httpbin.org/status/404')
>>> r.status_code
404
Posted by: Guest on June-15-2020
0

python response

# It is the response you get. It has many attributes.

import requests

response = request.get('https://abc.com')

print(response.[the response attribute])

# Some response attributes: 
response.status_code
response.json()
response.text
Posted by: Guest on February-26-2021

Browse Popular Code Answers by Language