Python demande en tête
url = 'https://api.github.com/some/endpoint'
headers = {'user-agent': 'my-app/0.0.1'}
r = requests.get(url, headers=headers)
Glamorous Gibbon
url = 'https://api.github.com/some/endpoint'
headers = {'user-agent': 'my-app/0.0.1'}
r = requests.get(url, headers=headers)
import requests
# Making a GET request
r = requests.get('https://api.github.com/users/naveenkrnl')
# check status code for response received
# success code - 200
print(r)
# print content of request
print(r.content)
>>> import requests
>>> r = requests.get('http://httpbin.org/status/404')
>>> r.status_code
404
# pip install requests
import requests
req = requests.get('<url here>', 'html.parser')
print(req.text)