Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Curl 沃森视觉识别错误代码400_Curl_Ibm Cloud_Ibm Watson_Visual Recognition - Fatal编程技术网

Curl 沃森视觉识别错误代码400

Curl 沃森视觉识别错误代码400,curl,ibm-cloud,ibm-watson,visual-recognition,Curl,Ibm Cloud,Ibm Watson,Visual Recognition,我正在尝试对一幅图像进行分类,并遵循这一点。这是我的cURL命令: curl -X POST -F "images_file=~/fish.jpg" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key=12fdsxxxxxxxsadasdxxxxxxdsa45654&version=2016-05-20" 我从沃森那里得到了这样的回应: { "error" : {

我正在尝试对一幅图像进行分类,并遵循这一点。这是我的cURL命令:

curl -X POST -F "images_file=~/fish.jpg" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key=12fdsxxxxxxxsadasdxxxxxxdsa45654&version=2016-05-20"
我从沃森那里得到了这样的回应:

{
  "error" : {
     "code": 400,
     "description": "No images were specified.",
     "error_id": "input_error"
  },
  "images_processed":0
}
我的图像在
C:/User/Rajesh Kumar/
中,cURL在
Rajesh中执行Kumar@RAJESH_KUMAR~
。我知道问题出在cURL命令中,但不知道是什么。请帮我解决这个问题


提前谢谢

确保您与
fish.jpg
位于同一目录中。然后运行此命令(替换API密钥):

不要使用tilda


刚刚尝试了一下,它成功了——以下是步骤:

第1步:

下载此文件,并将其另存为
fish.jpg

第二步:

确保您位于正确的目录中:

第三步:

替换此命令中的API密钥并运行它:

curl -X POST -F "images_file=@fish.jpg" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key={api-key}&version=2016-05-20"
第4步:

☺ ☺ ☺


我甚至尝试了curl-X POST-F“images_file=@~/fish.jpg”“,但没有任何帮助。谢谢,它现在可以工作了。问题是我在错误的目录中,使用了波浪号(~)而不是@。
curl -X POST -F "images_file=@fish.jpg" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key={api-key}&version=2016-05-20"