Python/requests: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
(Created page with "<source lang="python"> </source>")
 
No edit summary
Line 1: Line 1:
<source lang="python">
<source lang="python">
import requests
from requests.exceptions import ConnectionError


try:
    resp = requests.get()
    if resp.status_code == 200:
        pass
    else:
        pass
except requests.exceptions.ConnectionError as ex:
    pass
</source>
</source>

Revision as of 09:43, 9 October 2019

import requests
from requests.exceptions import ConnectionError

try:
    resp = requests.get()
    if resp.status_code == 200:
        pass
    else:
        pass
except requests.exceptions.ConnectionError as ex:
    pass