Could not resolve proxy: POST (while running curl script for watson document conversion)
Asked Answered
E

3

18

I'm running a curl script for HTML document conversion with a HTML file config. Below is the code:

curl -x POST -u "Username":"Password" -F "[email protected]" -F "[email protected];type=text/html" "https://gateway.watsonplatform.net/document-conversion/api/v1/index_document?version=2015-12-15"

I'm getting error - Could not resolve proxy: POST. If anyone could help on this please?

Note - I have curl 7.46 installed

Edo answered 10/7, 2017 at 13:26 Comment(0)
H
71

I am learning curl recently and encountered this as well. Actually, the reason is that the -x should be replaced by -X.

Heddie answered 1/8, 2018 at 10:41 Comment(1)
I guess this should be the accepted answer, helped me to correct my typo, thanks!Melodie
G
0

You error seems like one proxy config problem.

Try use --noproxy flag:

Example:

curl --noproxy 127.0.0.1 +your POST

Or try set your proxy, like my example:

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

Obs.: Use the specified HTTP proxy. If the port number isn't specified, will be 1080 for default.

Gelasius answered 10/7, 2017 at 14:6 Comment(2)
Thanks, After resolving the proxy error ., nowI am getting an error for Content-Type. Below is the error which I am getting- "code" : 400, "error" : "Error from server at WATSONRETRIEVE_CLOUDSEARCH: ERROR: [doc=58afeff9-b919-4ab1-bfb3-a060c8e93131] unknown field 'Content-Type'"Edo
Hello @Edo ... the error you are getting now seems to be related to other problem . Therefore, you should ask a new question, and accept this answer if it solved your problem.Evans
S
-3
  1. download and install GIT
  2. write the command curl -X, for example curl -X POST "yourwebsite.js"
Slogan answered 28/7, 2021 at 12:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.