From 6b1e81c41017cf05b742a8f4ef4e50b3a1a51aa8 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 14 Jun 2012 12:51:28 -0400 Subject: [PATCH] cleanup #676 --- docs/user/advanced.rst | 55 ++++---------------------------------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 6fb02a0..31c6760 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -51,18 +51,18 @@ Request and Response Objects Whenever a call is made to requests.*() you are doing two major things. First, you are constructing a ``Request`` object which will be sent of to a server to request or query some resource. Second, a ``Response`` object is generated -once ``requests`` gets a response back from the server. The response object +once ``requests`` gets a response back from the server. The response object contains all of the information returned by the server and also contains the ``Request`` object you created originally. Here is a simple request to get some very important information from Wikipedia's servers:: - + >>> response = requests.get('http://en.wikipedia.org/wiki/Monty_Python') If we want to access the headers the server sent back to us, we do this:: - + >>> response.headers {'content-length': '56170', 'x-content-type-options': 'nosniff', 'x-cache': - 'HIT from cp1006.eqiad.wmnet, MISS from cp1010.eqiad.wmnet', 'content-encoding': + 'HIT from cp1006.eqiad.wmnet, MISS from cp1010.eqiad.wmnet', 'content-encoding': 'gzip', 'age': '3080', 'content-language': 'en', 'vary': 'Accept-Encoding,Cookie', 'server': 'Apache', 'last-modified': 'Wed, 13 Jun 2012 01:33:50 GMT', 'connection': 'close', 'cache-control': 'private, s-maxage=0, max-age=0, @@ -77,53 +77,6 @@ request, and then the request's headers:: {'Accept-Encoding': 'identity, deflate, compress, gzip', 'Accept': '*/*', 'User-Agent': 'python-requests/0.13.1'} -Requests have these attributes: - - * Variable Attributes - * allow_redirects - * auth - * cert - * config - * cookies - * data - * files - * headers - * hooks - * method - * params - * prefetch - * proxies - * redirect - * response - * sent - * session - * timeout - * url - * Class Methods - * deregister_hook - * full_url - * path_url - * register_hook - * send - -Responses have the following attributes: - - * Variable Attributes - * config - * cookies - * encoding - * error - * headers - * history - * raw - * request - * status_code - * url - * Class Methods - * content - * json - * raise_for_status - * text SSL Cert Verification --------------------- -- 2.7.4