0

I want to upload an image that captured in swift application so the image as object I need to do this thru http request First I tried to do that with curl but I got an error that the string is too long second I tried with the example code that published in the site and that not works

Code example from the site:

curl -X POST
    -H 'Authorization: Key YOUR_API_KEY'
    -H "Content-Type: application/json"
    -d '
    {
      "inputs": [
        {
          "data": {
            "image": {
              "url": "https://samples.clarifai.com/demographics.jpg"
            }
          }
        }
      ]
    }'

https://api.clarifai.com/v2/models/c0c0ac362b03416da06ab3fa36fb58e3/outputs

I want to upload an image as object UIImage that captured in swift, not as URL

Bhavik Modi
  • 1,517
  • 14
  • 29

1 Answers1

0

Try the following curl command:

curl -X POST \
     -H "Authorization: Key YOUR_API_KEY" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d '{"inputs":[{"data":{"image":{"url":"https://samples.clarifai.com/demographics.jpg"}}}]}' \
     https://api.clarifai.com/v2/models/c0c0ac362b03416da06ab3fa36fb58e3/outputs

It seems to have worked for me.

D Cirne
  • 51
  • 2