summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorCory Benfield <lukasaoz@gmail.com>2016-06-08 09:44:33 -0700
committerIan Cordasco <sigmavirus24@users.noreply.github.com>2016-06-08 11:44:33 -0500
commit7a404cf4ec5aac04d72dc507a981fee944b18cd8 (patch)
tree765e247b4da39b96397c80612feda76ffde9e656 /docs
parent8813787a12022e0a8a99ba5c8cf4c6eb6e127d36 (diff)
downloadpython-requests-7a404cf4ec5aac04d72dc507a981fee944b18cd8.tar.gz
Document header ordering. (#3295)
Diffstat (limited to 'docs')
-rw-r--r--docs/user/advanced.rst9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst
index 8264e85d..cf0143ce 100644
--- a/docs/user/advanced.rst
+++ b/docs/user/advanced.rst
@@ -208,7 +208,7 @@ You can pass ``verify`` the path to a CA_BUNDLE file or directory with certifica
>>> requests.get('https://github.com', verify='/path/to/certfile')
-.. note:: If ``verify`` is set to a path to a directory, the directory must have been processed using
+.. note:: If ``verify`` is set to a path to a directory, the directory must have been processed using
the c_rehash utility supplied with OpenSSL.
This list of trusted CAs can also be specified through the ``REQUESTS_CA_BUNDLE`` environment variable.
@@ -899,6 +899,13 @@ Two excellent examples are `grequests`_ and `requests-futures`_.
.. _`grequests`: https://github.com/kennethreitz/grequests
.. _`requests-futures`: https://github.com/ross/requests-futures
+Header Ordering
+---------------
+
+In unusual circumstances you may want to provide headers in an ordered manner. If you pass an ``OrderedDict`` to the ``headers`` keyword argument, that will provide the headers with an ordering. *However*, the ordering of the default headers used by requests will be preferred, which means that if you override default headers in the ``headers`` keyword argument, they may appear out of order compared to other headers in that keyword argument.
+
+If this is problematic, users should consider setting the default headers on a :class:`Session <requests.Session>` object, by setting :data:`Session <requests.Session.headers>` to a custom ``OrderedDict``. That ordering will always be preferred.
+
.. _timeouts:
Timeouts