python3 print html response code example
Example 1: python get html from url
import requests
url = requests.get("http://google.com")
htmltext = url.text
Example 2: 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())