mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #2135 from dpursehouse/fix-meth-and-class-directives
Docs: Fix :class: and :meth: directives
This commit is contained in:
@@ -80,7 +80,7 @@ request, and then the request's headers::
|
||||
Prepared Requests
|
||||
-----------------
|
||||
|
||||
Whenever you receive a :class:`Response <requests.models.Response>` object
|
||||
Whenever you receive a :class:`Response <requests.Response>` object
|
||||
from an API call or a Session call, the ``request`` attribute is actually the
|
||||
``PreparedRequest`` that was used. In some cases you may wish to do some extra
|
||||
work to the body or headers (or anything else really) before sending a
|
||||
@@ -117,7 +117,7 @@ However, the above code will lose some of the advantages of having a Requests
|
||||
:class:`Session <requests.Session>` object. In particular,
|
||||
:class:`Session <requests.Session>`-level state such as cookies will
|
||||
not get applied to your request. To get a
|
||||
:class:`PreparedRequest <requests.models.PreparedRequest>` with that state
|
||||
:class:`PreparedRequest <requests.PreparedRequest>` with that state
|
||||
applied, replace the call to :meth:`Request.prepare()
|
||||
<requests.Request.prepare>` with a call to
|
||||
:meth:`Session.prepare_request() <requests.Session.prepare_request>`, like this::
|
||||
|
||||
@@ -367,9 +367,10 @@ HEAD.
|
||||
|
||||
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.
|
||||
The :meth:`Response.history <requests.Response.history>` list contains the
|
||||
:class:`Request <requests.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::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user