curl-users
Re: cURL doesnt seem to pass multiple headers using multiple -H options
Date: Mon, 2 Feb 2004 22:55:33 +0100 (CET)
On Mon, 2 Feb 2004, Kristopher Spencer-Yates wrote:
> It appears my headers still aren't being received. In fact, I am changing
> the CONTENT-TYPE header with -H and using -0 for http1.0 but the receiver
> does not receive what I think it should (my headers).. here is my command
> line
I think you're somehow not doing it right. I simply can't make this fail when
I try to use it.
> /usr/local/bin/curl -0 -X "/AUTHORIZE" -d "<someXML></someXML" -m 120 -H
> "MIME-VERSION: 1.0" -H "CONTENT-TYPE: application/PTI21" -H
> "CONTENT-TRANSFER-ENCODING: text" -H "REQUEST-NUMBER: 1" -H
> "DOCUMENT-TYPE: Request" http://the_url:the_portnumber -L
Why are you using uppercase all over? It makes my head hurt! ;-)
I tried this:
$ cd tests
[ cd'ed into the tests directory ]
$ ./server/sws &
[ started the test WWW server that runs on port 8999 by default]
$ curl localhost:8999/1 -H "test1: yes" -H "test2: yes" -H "Pragma: fake" -H
"Host: lalala" -H "ACCEPT: woohoo"
[ this fetches the data from test case 1, with an additional set of fun -H
arguments ]
$ cat log/server.input
GET /1 HTTP/1.1
User-Agent: curl/7.10.6 (i686-pc-linux-gnu) libcurl/7.10.6 OpenSSL/0.9.7a ipv6
zlib/1.1.3 GSS
test1: yes
test2: yes
Pragma: fake
Host: lalala
ACCEPT: woohoo
[ this shows a somewhat older version supporting all this that I claim it
does. Using my dev version gives the same result. ]
> Output from receiver below:
> ACCEPT: IMAGE/GIF, IMAGE/X-XBITMAP, IMAGE/JPEG, IMAGE/PJPEG, */*
> USER-AGENT: CURL/7.10.8 (I386-PORTBLD-FREEBSD4.8) LIBCURL/7.10.8
> OPENSSL/0.9.7A
Why is the receiver converting everything to uppercase?
> Any ideas on how I should pass multiple headers? What am I missing? Or is
> this not possible?
I don't understand how this cannot work for you. It works for me, as above.
-- Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/ [[ Do not send mails to this email address. They won't reach me. ]] ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdnReceived on 2004-02-02