aux = imagem.read().encode("base64")
files = {'file':aux}
headers = {'content-type': 'multipart/form-data'}
r = requests.post(url, files=files, headers=headers)
The conversion to base64 is working already checked by doing the reverse of the file. The question is in the request because for some reason the information that arrives on the server is in different form.
For example before the request:
files = {'file':'/9j/4AAQSkZJ....'}
But by printing what resquest sends I actually realized that base64 is different:
files = {'file':'%2f9....'}
For this reason I get an error message
{
"response": "Error. Make a POST request with a single field called 'file' containing a base64.",
"success": "false"
}
This service I am using is working normally, I tested using Postman
Python 2.7.15rc1 and Flask
Does anyone know what's going on? Thank you in advance.