HI all
I’m struggling to convert the following Curl to Requests.
curl -X POST \
-H "Authorization: Key API_key" \
-H "Content-Type: application/json" \
-d '
{
"inputs": [
{
"data": {
"image": {
"base64": "'"$(base64 /Users/robincole/Documents/Github/simple-clarifai/metro-north.jpg)"'"
}
}
}
]
}'\
https://api.clarifai.com/v2/models/aaa03c23b3724a16a56b629203edc62c/outputs
I’ve tried several variants on the following with no success:
HEADERS = {'content-type': 'application/json', 'Authorization': 'Key ' +API_key}
with open(filename, 'rb') as image_data:
response = requests.get(url=ENDPOINT_URL, headers=HEADERS, data=image_data)
Cheers