Python‎ > ‎requests‎ > ‎

requests.HTTPError


Definition
Provides exception of HTTPError as  to request and response.

Syntax
requests.HTTPError

Parameters

Examples
The code return with the exception of HTTPError because URL error.
 >>> try:
...     r=requests.get('http://www.pythonlake.c/turtle',params='turtle')
...     t=r.text
...     print(t)
... except:
...     print(e)
...     
<class 'requests.exceptions.HTTPError'>


The code return with the exception of HTTPError because URL error.
 >>> try:
...     r=requests.get('http://www.pythonlake.c/turtle',params='turtle')
...     t=r.text
...     print(t)
... except:
...     print(e)
...     
<class 'requests.exceptions.HTTPError'>

Comments