# requests 2.34.2 (Apache-2.0), harvested by tools/harvest_corpus.py
=== input

The ``codes`` object defines a mapping from common names for HTTP statuses
to their numerical codes, accessible either as attributes or as dictionary
items.

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
``codes.okay`` all correspond to the HTTP status code 200.

=== parse rest
short_description: |
  The ``codes`` object defines a mapping from common names for HTTP statuses
  to their numerical codes, accessible either as attributes or as dictionary
  items.
long_description: |
  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
  ``codes.okay`` all correspond to the HTTP status code 200.
blank_after_short_description: True
blank_after_long_description: False
style: rest
=== detect
rest
=== compose rest
The ``codes`` object defines a mapping from common names for HTTP statuses
to their numerical codes, accessible either as attributes or as dictionary
items.

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
``codes.okay`` all correspond to the HTTP status code 200.
