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

Rex*_*Rex 4 curl ibm-watson

我正在运行一个带有HTML文件配置的curl脚本以进行html文档转换。下面是代码:

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"
Run Code Online (Sandbox Code Playgroud)

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

注意-我已经curl 7.46安装

小智 15

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


Say*_*chi 0

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

尝试使用--noproxy标志:

例子:

curl --noproxy 127.0.0.1 +your POST
Run Code Online (Sandbox Code Playgroud)

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

curl --proxy <[protocol://][user:password@]proxyhost[:port]> +your POST
Run Code Online (Sandbox Code Playgroud)

观察:使用指定的HTTP代理。如果不指定端口号,则默认为 1080。