14

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 "config=@config.json" -F "file=@example.html;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

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Rex
  • 161
  • 1
  • 1
  • 7

3 Answers3

64

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

Kangwei Xiao
  • 643
  • 5
  • 5
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.

Sayuri Mizuguchi
  • 5,250
  • 3
  • 26
  • 53
  • 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'" – Rex Jul 10 '17 at 18:34
  • 1
    Hello @Rex ... 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. – DarkCygnus Jul 10 '17 at 19:32
-3
  1. download and install GIT
  2. write the command curl -X, for example curl -X POST "yourwebsite.js"
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
yazid
  • 11