Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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())
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #response #object #python
ADD COMMENT
Topic
Name
5+4 =