From: David Pursehouse Date: Tue, 15 Jul 2014 09:26:51 +0000 (+0900) Subject: Restructure "Redirection and History" section in quickstart documentation X-Git-Tag: v2.4.0~27^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8a4c9828aea6f5159cddc2786d4a74426f9dd4f;p=services%2Fpython-requests.git Restructure "Redirection and History" section in quickstart documentation Change-Id: Ida38d551e8cd0edaeb92d09de411a6f4a3d0578b --- diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 28e4497..128c578 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -362,11 +362,16 @@ parameter:: Redirection and History ----------------------- -Requests will automatically perform location redirection for all verbs except +By default Requests will perform location redirection for all verbs except HEAD. -GitHub redirects all HTTP requests to HTTPS. We can use the ``history`` method -of the Response object to track redirection. Let's see what GitHub does:: +We can use the ``history`` property of the Response object to track redirection. + +The :meth:`Response.history` list contains the :class:`Request` objects that +were created in order to complete the request. The list is sorted from the +oldest to the most recent request. + +For example, GitHub redirects all HTTP requests to HTTPS:: >>> r = requests.get('http://github.com') >>> r.url @@ -376,9 +381,6 @@ of the Response object to track redirection. Let's see what GitHub does:: >>> r.history [] -The :class:`Response.history` list contains the :class:`Request` objects that -were created in order to complete the request. The list is sorted from the -oldest to the most recent request. If you're using GET, OPTIONS, POST, PUT, PATCH or DELETE, you can disable redirection handling with the ``allow_redirects`` parameter::