Daniele Votta
Daniele Votta

Reputation: 11

Response 413 - Python requests trying POST .png file

I'm using python requests to do a simple post and I need to send a .png image.

...
headers ={'User-Agent':'Mozilla/5.0 , ...}
url = "http://example_url/xxx"
files = {'image': open('a.png', 'rb')}
    response = requests.post(url,headers=headers,files=files,)
    print (response.status_code)
    return response.text

Canno't figure out why I received back a 413 response code from server.

Thank You

Upvotes: 1

Views: 911

Answers (1)

fjfuente
fjfuente

Reputation: 11

413 is a Payload Too Large. This is a configure from the server. Check this URL https://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/

Good Luck!

Upvotes: 1

Related Questions