cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Kees Nijssen <kees.nijssen_at_quicknet.nl>
Date: Tue, 29 May 2012 22:24:43 +0200

On 29-05-2012 19:28, Carmody, Steven wrote:
Thanks for the advice. I upgraded to the recently released 7..26.0. BUt,
I'm getting the same result

curl_command = curl --verbose --insecure -o /tmp/tmp.PPKOU32382 -c
/tmp/tmp.RvrTn32380 -b /tmp/tmp.RvrTn32380 -X POST -d
@/tmp/tmp.eZjTn32398 -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
<http://stc-test3.cis.brown.edu> port 80 (#0)
* Trying 128.148.46.20...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* connected
* Connected to stc-test3.cis.brown.edu <http://stc-test3.cis.brown.edu>
(128.148.46.20) port 80 (#0)
> POST /Shibboleth.sso/SAML2/ECP HTTP/1.1
> User-Agent: curl/7.26.0
> Host: stc-test3.cis.brown.edu <http://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

It looks like you just made a typo in your own -H "Content-Type:
application/vnd.paos+xml" option. It depends a little on your
mail-client, but the dash between "Content" and "Type" isn't the regular
one! That's why curl doesn't replace the original header entry.

With regards,

Kees

0 7278 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0< HTTP/1.1 100 Continue
} [data not shown]
< HTTP/1.1 500 Internal Server Error
< Date: Tue, 29 May 2012 17:21:41 GMT
< Server: Apache/2.2.3 (CentOS)
< Expires: Wed, 01 Jan 1997 12:00:00 GMT
< Cache-Control: private,no-store,no-cache,max-age=0
< Content-Length: 956
< Connection: close
< Content-Type: text/html; charset=UTF-8
<
{ [data not shown]
100 8234 100 956 100 7278 49807 370k --:--:-- --:--:-- --:--:-- 546k
* Closing connection #0
curl is including my header, but is also including the standard "
Content-Type: application/x-www-form-urlencoded", which is causing
problems on the target system.

Any suggestions ? Any additional info I can provide, or options to try ?

Thanks!

-------------------------------------------------------------------
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-29