# _*_ coding :utf-8 _*_
import requests

r = requests.get('http://httpbin.org/get')
print(r.status_code)
print(r.status_code == requests.codes.ok)
bad_r = requests.get('http://httpbin.org/status/404')
print(bad_r.status_code)
# bad_r.raise_for_status()
print(r.raise_for_status())
print(r.headers)
print(r.headers['connection'])
print(r.headers['COnnection'])
9d4b05220b2ed844bbb80ca98d9c2760c4edb652
<mask token>

<mask token>
print(r.status_code)
print(r.status_code == requests.codes.ok)
<mask token>
print(bad_r.status_code)
print(r.raise_for_status())
print(r.headers)
print(r.headers['connection'])
print(r.headers['COnnection'])

<mask token>
r = requests.get('http://httpbin.org/get')
print(r.status_code)
print(r.status_code == requests.codes.ok)
bad_r = requests.get('http://httpbin.org/status/404')
print(bad_r.status_code)
print(r.raise_for_status())
print(r.headers)
print(r.headers['connection'])
print(r.headers['COnnection'])

import requests
r = requests.get('http://httpbin.org/get')
print(r.status_code)
print(r.status_code == requests.codes.ok)
bad_r = requests.get('http://httpbin.org/status/404')
print(bad_r.status_code)
print(r.raise_for_status())
print(r.headers)
print(r.headers['connection'])
print(r.headers['COnnection'])

# _*_ coding :utf-8 _*_
import requests

r = requests.get('http://httpbin.org/get')
print(r.status_code)
print(r.status_code == requests.codes.ok)
bad_r = requests.get('http://httpbin.org/status/404')
print(bad_r.status_code)
# bad_r.raise_for_status()
print(r.raise_for_status())
print(r.headers)
print(r.headers['connection'])
print(r.headers['COnnection'])