So I am working on sending images to an url. And I planned to use Python to make the POST requests. My code looks like this:
import requests
headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.90 Safari/537.36'}
response = requests.request('POST', url, headers=headers, files={'file':open('1-watermarked-page.PNG', 'rb')})
print (response.status_code)
When I run this, I am getting a status code of 500. I tried to replace the "files" parameter by "data" and it gives me an error of 413: import requests
headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.90 Safari/537.36'}
response = requests.request('POST', url, headers=headers, data={'file':open('1-watermarked-page.PNG', 'rb')})
print (response.status_code)
Can anyone please tell me where am I making a mistake?
Thanks!