1# pip install requests
2import requests
3req = requests.get('<url here>', 'html.parser')
4print(req.text)
1>>> r = requests.post('https://httpbin.org/post', data = {'key':'value'})
2
1Raise an exception if a request is unsuccessful
2
3import requests
4url = "http://mock.kite.com/status/404"
5r = requests.get(url)
6try:
7 r.raise_for_status()
8except requests.exceptions.HTTPError as e:
9 print e
10OUTPUT
11404 Client Error: NOT FOUND
1requests.post('https://identitytoolkit.googleapis.com/v1/accounts:signUp?key={}'.format(apikey))