Below is my code. I am trying to make a POST operation using python with REST API. I have an image I want to post. I get error saying;
"'code': 'BadRequest', 'message': "Could not process incoming request: 'Missing content-type boundary.'. Please ensure that it is well-formed"
Where am I making mistake?
import requests
headers = {
'accept': 'application/json',
'Content-Type': 'multipart/form-data',
#'boundary':'---BOUNDRY'
}
params = (
('returnFaceId', 'true'),
('returnFaceLandmarks', 'true'),
)
files = {
'form': (open('image.jpg', 'rb'),'image/jpg'),
}
response = requests.post('http://localhost:5000/face/v1.0/detect', headers=headers, params=params, files=files)
print (response.json())