Using headers with the Python requests library’s get method

According to the API, the headers can all be passed in with requests.get():

import requests
r=requests.get("http://www.example.com/", headers={"Content-Type":"text"})

Leave a Comment