Merge pull request #5195 from lzutao/patch-1

Fix formatting of status code example
This commit is contained in:
Nate Prewitt
2019-09-19 08:32:13 -07:00
committed by GitHub
+10 -7
View File
@@ -4,13 +4,16 @@ r"""
The ``codes`` object defines a mapping from common names for HTTP statuses
to their numerical codes, accessible either as attributes or as dictionary
items.
>>> import requests
>>> requests.codes['temporary_redirect']
307
>>> requests.codes.teapot
418
>>> requests.codes['\o/']
200
Example::
>>> import requests
>>> requests.codes['temporary_redirect']
307
>>> requests.codes.teapot
418
>>> requests.codes['\o/']
200
Some codes have multiple names, and both upper- and lower-case versions of
the names are allowed. For example, ``codes.ok``, ``codes.OK``, and