AnsweredAssumed Answered

Implementing POST request using new CURL option

Question asked by joshmora on Jun 12, 2017
Latest reply on Aug 31, 2017 by JeffHenry

There have been a handful of questions on implementing curl options with the new Specify CURL Options for Insert from URL. However, none seem to resolve the following. Specifically, I'm try to submit the following which works perfect from the command line:

 

 curl -X POST -H "Authorization: Bearer XIkzBmcmK05Ja4h9FmSeHfZWQHylUW" 
 -H "Content-Type: application/json" 
 -d ' { "inputs": [ { "data": { "image": { "url": "https://samples.clarifai.com/metro-north.jpg" } } } ] }' 
https://api.clarifai.com/v2/models/aaa03c23b3724a16a56b629203edc62c/outputs

 

After the innumerable permutations of spaces and back slashes the closest I could come is the following for the Specify CURL Options with api.clarifai.com URL in the URL field:

 

" --header \"Content-Type: application/json\"" & 
" --header \"Authorization: Bearer XIkzBmcmK05Ja4h9FmSeHfZWQHylUW\"" & 
" --data '{\"inputs\": [{\"data\": {\"image\": {\"url\": \"https://samples.clarifai.com/metro-north.jpg\" } } } ] }'"

 

However, the API still returns a malformed request error.

 

Any suggestions?

 

thanks!

Outcomes