Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a Response object in python?

While using requests to download a webpage, we store the result of that operation in a response object. What I could not understand is, exactly what is stored in the response object? Is it the source code of that page in HTML or is it the entire string on the page that is stored?


1 Answers

It is an instance of the lower level Response class of the python requests library. The literal description from the documentation is..

The Response object, which contains a server's response to an HTTP request.

Every HTTP request sent returns a response from the server (the Response object) which includes quite a bit of information.

You can find all the info you need here, and also here is the github link.

like image 125
Seth G Avatar answered Sep 19 '25 00:09

Seth G