卷曲 - 无法解析代理:POST(运行watson文档转换的curl脚本时)

时间:2017-07-10 13:26:39

标签: curl ibm-watson

我正在使用html文件配置运行用于html文档转换的curl脚本。以下是代码:

curl -x POST -u "Username":"Password" -F "config=@config.json" -F "file=@example.html;type=text/html" "https://gateway.watsonplatform.net/document-conversion/api/v1/index_document?version=2015-12-15"

我收到错误 - Could not resolve proxy: POST。如果有人可以帮忙吗?

注意 - 我已安装curl 7.46

3 个答案:

答案 0 :(得分:8)

我最近正在学习curl,也遇到了这种情况。实际上,原因是-x应该替换为-X

答案 1 :(得分:0)

您的错误似乎是一个代理配置问题。

尝试使用--noproxy标志:

示例:

curl --noproxy 127.0.0.1 +your POST

或尝试设置您的代理,就像我的例子:

curl --proxy <[protocol://][user:password@]proxyhost[:port]> +your POST

Obs。:使用指定的HTTP代理。如果未指定端口号,则默认为1080.

答案 2 :(得分:-2)

  1. 下载并安装 GIT
  2. 编写命令 curl -X,例如 curl -X POST "yourwebsite.js"