【发布时间】:2016-06-23 21:18:22
【问题描述】:
如果我通过curl SOAP 服务器:
curl 'http://the-soap-server' -H 'Content-Type: text/xml; charset=utf-8' \
-H 'SOAPAction: http://tempuri.org/Action' -X POST \
--data '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Booking>
...
</soapenv:Body>
</soapenv:Envelope>'
我收到来自soap 服务器的错误响应。然而奇怪的是,如果我将该请求存储在一个文件中并通过以下方式发出相同的请求:
cat stored.xml | curl 'http://the-soap-server' -H 'Content-Type: text/xml; charset=utf-8' \
-H 'SOAPAction: http://tempuri.org/Action' -X POST \
--data @-
它突然起作用了。这些 curl 请求有何不同?
【问题讨论】:
标签: curl soap http-post httprequest newline