0 Replies Latest reply on Jun 13, 2017 11:15 AM by joshmora

    Implementing POST request using new CURL option

    joshmora

      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!