Answers for "response 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 send get request with headers

r=requests.get("http://www.example.com/", headers={"content-type":"text"})
Posted by: Guest on November-16-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
3

python requests get

# pip install requests
import requests
req = requests.get('<url here>', 'html.parser')
print(req.text)
Posted by: Guest on April-06-2020

Browse Popular Code Answers by Language