0
votes

curl -X POST -F "[email protected]" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/detect_faces?api_key={api-key}&version=2016-05-20"

this is a sample curl post command to post one image file to api connect.

I published this api to api connect developer portal. but don't know how to post image file to my api using api connect's format.

api connect example: curl --request POST \ --url https://api.us.apiconnect.ibmcloud.com/wlwwucnibmcom-dev/ibmtesting/vision5/classify \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'x-ibm-client-id: REPLACE_THIS_KEY' \ --header 'x-ibm-client-secret: REPLACE_THIS_KEY'

which format I should use to post my request???

1
In your first cURL command, you are sending images_file, but in the second one, I don't see any actual data being sent.MBillau

1 Answers

0
votes

Using the API Designer you can test your APIs. The designer also provides examples for each API call, including cURL syntax that you are looking for: enter image description here

An example is provided in the documentation:

curl --request POST \
  --url https://localhost:4002/api/notes \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-ibm-client-id: default' \
  --header 'x-ibm-client-secret: SECRET' \
  --data '{"title":"Buy eggs and milk"}' -k

For more information please follow the Explore Your REST API section in the Getting Stated: Run Your API documentation.