Skip to content
Myr

In docs, use intersphinx to link to Python documentation

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

The intersphinx extension can generate automatic links to the documentation of objects in other projects. It was already used for urllib3. For complete details on intersphinx, see: http://www.sphinx-doc.org/en/master/ext/intersphinx.html

authored by Jon Dufresne · committed by Jon Dufresne · parent 922aa40 · Browse files · 3 files+19 added−22 removed
This commit

State

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

Trailers

  • http: //www.sphinx-doc.org/en/master/ext/intersphinx.html

Diff stats

3 files+19 added−22 removed

  • other:+19 added−22 removed

3 files+19 added−22 removed

modified:docs/user/advanced.rst+10 added-14 removed
349 unmodified lines
350351 with open('massive-body', 'rb') as f:352 requests.post('http://some.url/streamed', data=f)353354.. warning:: It is strongly recommended that you open files in `binary mode`_.355 This is because Requests may attempt to provide the356 ``Content-Length`` header for you, and if it does this value will357 be set to the number of *bytes* in the file. Errors may occur if358 you open the file in *text mode*.354.. warning:: It is strongly recommended that you open files in :ref:`binary355 mode <tut-files>`. This is because Requests may attempt to provide356 the ``Content-Length`` header for you, and if it does this value357 will be set to the number of *bytes* in the file. Errors may occur358 if you open the file in *text mode*.359360.. _binary mode: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files360362361.. _chunk-encoding:362363Chunk-Encoded Requests364----------------------
40 unmodified lines
405 'Content-Type': 'multipart/form-data; boundary=3131623adb2043caaeb5538cc7aa0b3a',406 ...407 }408411.. warning:: It is strongly recommended that you open files in `binary mode`_.412 This is because Requests may attempt to provide the413 ``Content-Length`` header for you, and if it does this value will414 be set to the number of *bytes* in the file. Errors may occur if415 you open the file in *text mode*.409.. warning:: It is strongly recommended that you open files in :ref:`binary410 mode <tut-files>`. This is because Requests may attempt to provide411 the ``Content-Length`` header for you, and if it does this value412 will be set to the number of *bytes* in the file. Errors may occur413 if you open the file in *text mode*.414417.. _binary mode: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files415419416.. _event-hooks:417418Event Hooks419-----------
612 unmodified lines
modified:docs/user/quickstart.rst+5 added-7 removed
346 unmodified lines
347348For sending multiple files in one request refer to the :ref:`advanced <advanced>`349section.350351.. warning:: It is strongly recommended that you open files in `binary mode`_.352 This is because Requests may attempt to provide the353 ``Content-Length`` header for you, and if it does this value will354 be set to the number of *bytes* in the file. Errors may occur if355 you open the file in *text mode*.351.. warning:: It is strongly recommended that you open files in :ref:`binary352 mode <tut-files>`. This is because Requests may attempt to provide353 the ``Content-Length`` header for you, and if it does this value354 will be set to the number of *bytes* in the file. Errors may occur355 if you open the file in *text mode*.356357.. _binary mode: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files357359358Response Status Codes359---------------------360361We can check the response status code::
201 unmodified lines
modified:docs/conf.py+4 added-1 removed
374 unmodified lines
375376# If false, no index is generated.377#epub_use_index = True378379intersphinx_mapping = {'urllib3': ('https://urllib3.readthedocs.io/en/latest', None)}379intersphinx_mapping = {380 'python': ('https://docs.python.org/3/', None),381 'urllib3': ('https://urllib3.readthedocs.io/en/latest', None),382}