.. _grab_response: Work With Network Response ========================== Response Object --------------- The result of doing a network request via Grab is a `Response` object. You get a Response object as a result of calling to `g.go`, `g.request` and `g.submit` methods. You can also access the response object of a recent network query via the `g.response` attribute:: >>> from grab import Grab >>> g = Grab() >>> g.go('http://google.com') >>> g.response You can find a full list of response attributes in the Response API document. Here are the most important things you should know: :body: original body contents of HTTP response :code: HTTP status of response :headers: HTTP headers of response :charset: charset of the response :cookies: cookies in the response :url: the URL of the response document. In case of some automatically processed redirect, the `url` attribute contains the final URL. :name_lookup_time: time spent to resolve host name :connect_time: time spent to connect to remote server :total_time: total time spent to complete the request :download_size: size of received data :upload_size: size of uploaded data except the HTTP headers Now, a real example:: >>> from grab import Grab >>> g = Grab() >>> g.go('http://wikipedia.org') >>> g.response.body[:100] '\n\n\n