Answers for "how to get requests in python respone"

9

how to send get request python

import requests
requests.get("https://www.google.com/")
Posted by: Guest on January-05-2020
1

create a response object in python

from requests.models import Response

the_response = Response()
the_response.code = "expired"
the_response.error_type = "expired"
the_response.status_code = 400
the_response._content = b'{ "key" : "a" }'

print(the_response.json())
Posted by: Guest on June-09-2020

Python Answers by Framework

Browse Popular Code Answers by Language