cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Carmody, Steven <steven_carmody_at_brown.edu>
Date: Tue, 29 May 2012 13:28:18 -0400

On Fri, May 18, 2012 at 7:20 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Thu, 17 May 2012, Steven Carmody wrote:
>
> 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 ?
>>
>
> Note: You are using a VERY old curl version.
>
> That header is the default content-type sent by curl when you do a "plain"
> post with -d. If you override the content-type header with -H, curl should
> not send the default header as well but you seem to get that. It is a bug.
>
> I suggest you try a modern curl version where I believe this problem
> doesn't exist.
>
>
>
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 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 (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
> Accept: */*
> Content-Type: application/vnd.paos+xml
> Content-Length: 7278
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
  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