Get the description of a status code in Python Requests

Alternatively, in case of Python 2.x, you can use httplib.responses:

>>> import httplib
>>> httplib.responses[200]
'OK'
>>> httplib.responses[404]
'Not Found'

In Python 3.x, use http module:

In [1]: from http.client import responses

In [2]: responses[200]
Out[2]: 'OK'

In [3]: responses[404]
Out[3]: 'Not Found'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)