curl-library
Re: Not getting correct HTTP headers on POST
Date: Thu, 23 Apr 2009 23:40:09 +0200 (CEST)
On Thu, 23 Apr 2009, Tim Gross wrote:
> I adapted the sample program postit2.c and am trying to do a simple post.
> I am using tcpdump to examine the communication to the web server, and
> everything looks good except the HTTP headers. I specifically set 3 headers
> but they do not appear when I perform the POST. Any ideas how to do this?
> It seems very simple, but I haven't been able to figure it out. Here is the
> source code below.
...
> headerlist = curl_slist_append(headerlist, "FILE_SIZE=3130");
> headerlist = curl_slist_append(headerlist, "FILE_NAME=postit2.c");
> headerlist = curl_slist_append(headerlist, "ID=123");
These are not HTTP headers and they will not be sent by libcurl. HTTP headers
are "[name]:[content]" - the colon being important to the protocol and to
libcurl.
-- / daniel.haxx.seReceived on 2009-04-23