API Connect开发人员门户如何将文件发布到一个文件

时间:2016-09-08 06:41:14

标签: curl visual-recognition apiconnect

curl -X POST -F" images_file=@prez.jpg" " https://gateway-a.watsonplatform.net/visual-recognition/api/v3/detect_faces?api_key= {API密钥}&安培;版本= 2016年5月20日"

这是一个示例curl post命令,用于将一个图像文件发布到api connect。

我将此api发布到api connect开发人员门户网站。但不知道如何使用api connect的格式将图像文件发布到我的api。

api连接示例: 卷曲 - 请求POST \   --ur https://api.us.apiconnect.ibmcloud.com/wlwwucnibmcom-dev/ibmtesting/vision5/classify \   --header'接受:application / json' \   --header' content-type:application / json' \   --header' x-ibm-client-id:REPLACE_THIS_KEY' \   --header' x-ibm-client-secret:REPLACE_THIS_KEY'

我应该使用哪种格式发布我的请求???

1 个答案:

答案 0 :(得分:0)

使用API​​ Designer,您可以测试API。设计器还提供了每个API调用的示例,包括您要查找的cURL语法: enter image description here

文档中提供了一个示例:

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

有关详细信息,请参阅Getting Stated: Run Your API文档中的浏览您的REST API 部分。