curl-users
Re: MIME headers
Date: Mon, 02 Feb 2004 13:11:40 -0600
Hi,
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
/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
The only one that the receiver seems to actually receive is the last one
in my -H list, as if cURL rewrites CONTENT-TYPE but does send
DOCUMENT-TYPE. Output from receiver below:
AUTHORIZE / HTTP/1.1
HOST: deleted:deleted
ACCEPT: IMAGE/GIF, IMAGE/X-XBITMAP, IMAGE/JPEG, IMAGE/PJPEG, */*
CONTENT-LENGTH: 1469
CONTENT-TYPE: APPLICATION/X-WWW-FORM-URLENCODED
DOCUMENT-TYPE: REQUEST
PRAGMA: NO-CACHE
USER-AGENT: CURL/7.10.8 (I386-PORTBLD-FREEBSD4.8) LIBCURL/7.10.8 OPENSSL/0.9.7A
ZLIB/1.1.4
Any ideas on how I should pass multiple headers? What am I missing?
Thanks,
Kris
Daniel Stenberg wrote:
>On Mon, 2 Feb 2004, kris wrote:
>
>
>
>>Here is my output. I just have one -H "{headers}" with \n between each
>>header I want. Is this right or do I need a -H "{header}" for each header
>>to be sent?
>>
>>
>
>The latter. Also note that 'POST' is not a header, it is the actual request
>keyword, and you change that with -X. If you want to post to '/AUTHORIZE',
>then use that in the URL. If you really need HTTP 1.0, then use -0/--http1.0
>to make curl more stupid.
>
>
>
>>/usr/local/bin/curl -m 120 -H "POST /AUTHORIZE HTTP/1.0
>>MIME-Version: 1.0
>>Content-type: application/PTI21
>>Content-length: 1278
>>Content-transfer-encoding: text
>>Request-number: 1
>>Document-type: Request
>>
>>
>
>Also, try not to replace the Content-length: header, it will only cause you
>problems (when you set it wrong by one byte or so). Let curl add its own
>version of that header with the calculated size of the data.
>
>
>
-------------------------------------------------------
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/osdn
Received on 2004-02-02