summaryrefslogtreecommitdiff
path: root/docs/user/quickstart.rst
diff options
context:
space:
mode:
authorCory Benfield <lukasaoz@gmail.com>2015-10-14 13:23:19 +0100
committerCory Benfield <lukasaoz@gmail.com>2015-10-14 13:23:19 +0100
commit7c55446b7ec0978d38fceda5ad4bc45e5b26f1f1 (patch)
tree4925f4c8cc8593e5ee053abe3b03bf7fbee2d933 /docs/user/quickstart.rst
parent18a6b601100db978f3a6e191816456e75bc47e0f (diff)
downloadpython-requests-7c55446b7ec0978d38fceda5ad4bc45e5b26f1f1.tar.gz
Add warnings about text/binary mode files.
Diffstat (limited to 'docs/user/quickstart.rst')
-rw-r--r--docs/user/quickstart.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst
index d08561d2..75a22ce0 100644
--- a/docs/user/quickstart.rst
+++ b/docs/user/quickstart.rst
@@ -302,6 +302,14 @@ support this, but there is a separate package which does -
For sending multiple files in one request refer to the :ref:`advanced <advanced>`
section.
+.. warning:: It is strongly recommended that you open files in `binary mode`_.
+ This is because Requests may attempt to provide the
+ ``Content-Length`` header for you, and if it does this value will
+ be set to the number of *bytes* in the file. Errors may occur if
+ you open the file in *text mode*.
+
+.. _binary mode: https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files
+
Response Status Codes
---------------------