I have curl code recived a image file
curl -X GET -H 'Authorization: Bearer TOKENS' https://api.line.me/v2/bot/message/8595925133330/content -o image.png
how to get the file using python?
curl -X GET -H 'Authorization: Bearer TOKENS' https://api.line.me/v2/bot/message/8595925133330/content -o image.png
Comparable Python Script should be like below:
import requests
endpoint = "https://api.line.me/v2/bot/message/8595925133330/content"
headers = {"Authorization":"Bearer TOKENS"}
r = requests.post(endpoint,headers=headers)
open('image.png', 'wb').write(r.content)
requests? In particular, userequests.get(<URL>, ...).r = requests.get(endpoint, headers=headers)how i get image file or json?headersto. stackoverflow.com/help/how-to-ask