cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: POST and Headers

From: Clayton, Richard <richard.clayton_at_office2office.biz>
Date: Mon, 3 Nov 2003 15:53:16 -0000

Thanks for that.

If I use
curl --data-binary "@C:\rmtestpo.xml" -u user:password --header
CONTENT_TYPE:text/xml "https://test.banner-online.com/test.asp"

The following is received in the header by the server:

HTTP_ACCEPT:image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
HTTP_HOST:tesr.banner-online.com
HTTP_USER_AGENT:curl/7.10.5 (win32) libcurl/7.10.5 OpenSSL/0.9.7azlib/1.1.4
HTTP_PRAGMA:no-cache
HTTP_AUTHORIZATION:Basic cm1haWw6cmVkdmFu
HTTP_CONTENT_LENGTH:6710
HTTP_CONTENT_TYPE:application/x-www-form-urlencoded
HTTP_CONTENT_TYPE:text/xml

Is there any way of suppressing
HTTP_CONTENT_TYPE:application/x-www-form-urlencoded

Regards,

Richard

> -----Original Message-----
> From: Daniel Stenberg [SMTP:daniel_at_haxx.se]
> Sent: Thursday, October 30, 2003 7:54 AM
> To: Curl Mailinglist
> Subject: Re: POST and Headers
>
> On Wed, 29 Oct 2003, Clayton, Richard wrote:
>
> > when POSTing a file how do you stop the header getting posted with the
> file.
>
> > By this I mean when I post an XML file I want the file to start with the
> XML
> > tag rather than the four lines I get prior to it.
> >
> > That is:
>
> > ------------------------------1d315e070b3e
> > Content-Disposition: form-data; name="fileName";
> filename="C:\rmtestpo.xml"
> > Content-Type: text/plain
>
> Those are headers put there in order to make it a proper multipart
> formpost.
> If you don't want them, don't make it a multipart formpost!
>
> Put simply: you want -d, not -F.
>
> --
> Daniel Stenberg -- curl: been grokking URLs since 1998
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/

**********************************************************************************
This message is sent in strict confidence for the addressee only. It may
contain legally privileged information. The contents are not to be disclosed
to anyone other than the addressee. Unauthorised recipients are requested
to preserve this confidentiality and to advise the sender immediately of any
error in transmission.
This footnote also confirms that this email message has been swept for the
presence of computer viruses, however we cannot guarantee that this message
is free from such problems.
**********************************************************************************

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
Received on 2003-11-03