Skip to content
Myr

Restructure "Redirection and History" section in quickstart documentation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Pursehouse · committed by David Pursehouse · parent f5a2138 · Browse files · 1 file+8 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Change-Id: Ida38d551e8cd0edaeb92d09de411a6f4a3d0578b

Diff stats

1 file+8 added−6 removed

  • other:+8 added−6 removed

1 file+8 added−6 removed

modified:docs/user/quickstart.rst+8 added-6 removed
360 unmodified lines
361362Redirection and History363-----------------------364365Requests will automatically perform location redirection for all verbs except365By default Requests will perform location redirection for all verbs except366HEAD.367368GitHub redirects all HTTP requests to HTTPS. We can use the ``history`` method369of the Response object to track redirection. Let's see what GitHub does::368We can use the ``history`` property of the Response object to track redirection.369370The :meth:`Response.history` list contains the :class:`Request` objects that371were created in order to complete the request. The list is sorted from the372oldest to the most recent request.373374For example, GitHub redirects all HTTP requests to HTTPS::375376 >>> r = requests.get('http://github.com')377 >>> r.url378 'https://github.com/'379 >>> r.status_code380 200381 >>> r.history382 [<Response [301]>]383379The :class:`Response.history` list contains the :class:`Request` objects that380were created in order to complete the request. The list is sorted from the381oldest to the most recent request.384385If you're using GET, OPTIONS, POST, PUT, PATCH or DELETE, you can disable386redirection handling with the ``allow_redirects`` parameter::387
56 unmodified lines