cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl CLI appears to be eating parameters!

From: Dave Hodgkinson <davehodg_at_gmail.com>
Date: Mon, 1 Dec 2014 10:47:13 +0000

The curl we were building to talk to 1&1's Exchange was failing:

curl -v --ntlm -X POST "https://him%40domain.com:p
assword_at_1.exchange.1and1.eu/EWS/Exchange.asmx" -H
"x-xml-compile-soap-version: 3.05" -H "x-xml-compile-version: 1.47" -H
"x-xml-libxml-version: 2.0105" -H "x-xml-compile-cache-version: 1.02" -H
"x-lwp-version: 6.08" -H "Host: 1.exchange.1and1.eu" -H "Content-Type:
text/xml; charset=utf-8" -H "soapaction: \"
http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder\""
-H "Content-Length: 568" --data-binary "<?xml version=\"1.0\"
encoding=\"utf-8\"?> <soap:Envelope xmlns:soap=\"
http://schemas.xmlsoap.org/soap/envelope/\" xmlns:t=\"
http://schemas.microsoft.com/exchange/services/2006/types\">
<soap:Body> <GetFolder xmlns=\"
http://schemas.microsoft.com/exchange/services/2006/messages\"
xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">
<FolderShape> <t:BaseShape>Default</t:BaseShape>
</FolderShape> <FolderIds> <t:DistinguishedFolderId
Id=\"calendar\"/> </FolderIds> </GetFolder>
</soap:Body></soap:Envelope>"

...
...
> POST /EWS/Exchange.asmx HTTP/1.1
> Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
> User-Agent: curl/7.39.0
> Accept: */*
> x-xml-compile-soap-version: 3.05
> x-xml-compile-version: 1.47
> x-xml-libxml-version: 2.0105
> x-xml-compile-cache-version: 1.02
> x-lwp-version: 6.08
> Host: 1.exchange.1and1.eu
> Content-Type: text/xml; charset=utf-8
> soapaction: "
http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder"
>
< HTTP/1.1 411 Length Required

But if we move the Content-Length up the parameters:

curl -v --ntlm -X POST etC "https://him%40domain.com:p
assword_at_1.exchange.1and1.eu/EWS/Exchange.asmx" -H "x-lwp-version: 6.08"
-H "x-xml-libxml-version: 2.0105" -H "x-xml-compile-soap-version: 3.05"
-H "x-xml-compile-version: 1.47" -H "x-xml-compile-cache-version: 1.02"
-H "xContent-Length: 568" -H "Host: 1.exchange.1and1.eu" -H
"Content-Type: text/xml; charset=utf-8" -H "soapaction: \"
http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder\""
--data-binary "<?xml version=\"1.0\" encoding=\"utf-8\"?> <soap:Envelope
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:t=\"
http://schemas.microsoft.com/exchange/services/2006/types\">
<soap:Body> <GetFolder xmlns=\"
http://schemas.microsoft.com/exchange/services/2006/messages\"
xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">
<FolderShape> <t:BaseShape>Default</t:BaseShape>
</FolderShape> <FolderIds> <t:DistinguishedFolderId
Id=\"calendar\"/> </FolderIds> </GetFolder>
</soap:Body></soap:Envelope>"

...
...
> User-Agent: curl/7.39.0
> Accept: */*
> x-lwp-version: 6.08
> x-xml-libxml-version: 2.0105
> x-xml-compile-soap-version: 3.05
> x-xml-compile-version: 1.47
> x-xml-compile-cache-version: 1.02
> xContent-Length: 568
> Host: 1.exchange.1and1.eu
> Content-Type: text/xml; charset=utf-8
> soapaction: "
http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder"
> Content-Length: 568
>
* upload completely sent off: 568 out of 568 bytes
< HTTP/1.1 200 OK
< Cache-Control: private
< Transfer-Encoding: chunked
< Content-Type: text/xml; charset=utf-8
< Server: Microsoft-IIS/8.0
< request-id: 146a4d13-3de2-44b9-8152-d92f11106357

All that's happened is that Content-Length has been moved up the -H list.
Bug in curl?

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-12-01