cURL / Mailing Lists / curl-users / Single Mail

curl-users

when POSTing data, when does curl add the x-www-form header?

From: Steven Carmody <Steven_Carmody_at_brown.edu>
Date: Thu, 17 May 2012 16:45:57 -0400

I have two different apps that use curl to POST data to the same remote
remote apache server. Both apps run on the same client machine.

In both cases, they are posting SOAP data. In once case, tho, it
*appears* that curl is adding the Content-Type:
application/x-www-form-urlencoded header... I've run curl in verbose
mode, and pasted in the two sessions down below ...

Can anyone shed any light on where the extra Header is coming from, why
it is being included ?

Thanks!

---------- example with header

curl_command = curl --verbose --insecure -c /tmp/tmp.srXLK16077 -b
/tmp/tmp.srXLK16077 -X POST -d @/tmp/tmp.PDBpr16095 -H "Content−Type:
application/vnd.paos+xml"
http://stc-test3.cis.brown.edu/Shibboleth.sso/SAML2/ECP

* About to connect() to stc-test3.cis.brown.edu port 80
* Trying 128.148.46.20... connected
* Connected to stc-test3.cis.brown.edu (128.148.46.20) port 80
> POST /Shibboleth.sso/SAML2/ECP HTTP/1.1
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5
OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: stc-test3.cis.brown.edu
> Accept: */*
> Content−Type: application/vnd.paos+xml
> Content-Length: 7278
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>

------------ example, same machine, without header

curl_command = curl --verbose -o /tmp/tmp.tchVp16003 -c
/tmp/tmp.coUbk15990 -b /tmp/tmp.coUbk15990 -X POST -d
@/tmp/tmp.sdcvS16002 -H "Content-Type: application/vnd.paos+xml"
http://stc-test3.cis.brown.edu/Shibboleth.sso/SAML2/ECP

* About to connect() to stc-test3.cis.brown.edu port 80
* Trying 128.148.46.20... connected
* Connected to stc-test3.cis.brown.edu (128.148.46.20) port 80
> POST /Shibboleth.sso/SAML2/ECP HTTP/1.1
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5
OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: stc-test3.cis.brown.edu
> Accept: */*
> Content-Type: application/vnd.paos+xml
> Content-Length: 6416
> Expect: 100-continue
>
-------------------------------------------------------------------
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 2012-05-18