Currently working on a project and I need to post this request:
curl -X POST "http://localhost:8000/api/v1/recognition/recognize" \
-H "Content-Type: multipart/form-data" \
-H "x-api-key: xxxxxx-xxxxx-xxxx-xxxx-xxxxxxxx" \
-F "file=@<image>.jpg" #image
Tried several times with this code snippet had no luck:
import requests
headers = {
'Content-Type': 'multipart/form-data',
'x-api-key': 'xxxxxxxxxxxx',
}
files = {
'file': ('image.jpg', open('image.jpg', 'rb')),
}
response = requests.post('http://localhost:8000/api/v1/recognition/recognize', headers=headers, files=files)
print(response)
Am I doing something wrong or missing something?