178. Working with HTTP Headers
import requests
url = 'https://httpbin.org/get'
headers = {'User-Agent': 'my-app/1.0'}
response = requests.get(url, headers=headers)
print(response.text)import requests
url = 'https://httpbin.org/headers'
response = requests.get(url)
print("Response Headers:")
print(response.headers)Last updated