我正在尝试使用UNIX命令行调用Web服务
curl -v -X POST --header "Content-Type:text/xml;charset=UTF-8" --data @req.xml http://myip:port/somepath
我收到以下错误,需要一些可能的原因指针
* Trying myip...
* Failed to set TCP_KEEPALIVE on ----
* Connected to myip (myip port pot (#0)
> POST myurl HTTP/1.1
> Host: myip:myport
> User-Agent: curl/7.45.0
> Accept: */*
> Content-Type:text/xml;charset=UTF-8
> Content-Length: 620
>
* upload completely sent off: 620 out of 620 bytes
< HTTP/1.1 415 Unsupported Media Type
< Server: Apache-Coyote/1.1
< Content-Length: 0
< Date: Tue, 28 May 2019 12:17:29 GMT
<
* Connection #0 to host myip left intact
试图将Content-Type:text / xml更改为Content-Type: / 并删除字符集