Python Requests | HTTP Headers

preview_player
Показать описание
The Requests library has the ability to send custom headers with a request. In addition, the headers attached to an http response can be viewed using the Requests API.
Рекомендации по теме
Комментарии
Автор

How to set header when calling an API with client secret key and ID?

yasink
Автор

*In case anyone needs these, here you go.*




print("URL: ")
url = str(input())
headers = {'content-type': 'multipart/form-data'}
r = requests.post(url, headers=headers)
print(r.headers)


print("URL: ")
url = str(input())
headers = {'content-type': 'multipart/form-data'}
r = requests.post(url, headers=headers)
print(r.request.headers)

SootGizmo
join shbcf.ru