cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curlpp mailing list Archives

[cURLpp] Re: problem setting POST header

From: John Burnette <john.burnette_at_gmail.com>
Date: Sat, 18 Feb 2006 09:09:11 -0800

Another issue is that the binary stream that I send is only OK until it gets
to the first NULL, then the rest of the payload gets mangled. I noticed
someone had an issue like this in before but I couldn't find the mailing
list post that resolved the issue. This may stem from the wrong
"content-type" problem I am having. I am no HTTP expert though.

Do you think these two problems are related and do you know how I could
resolve them?

Thanks for your help.

John

On 2/17/06, John Burnette <john.burnette_at_gmail.com> wrote:
>
> Hi all,
>
> I am trying to set the "content-type" of the header that I am POSTing.
> Seems like it should be straightforward. Unfortunately, it's not working
> out. I set up my POST like this:
>
> // Setting the URL to retrive.
> m_HTTP_Handle.setOpt(new cURLpp::Options::Url(url));
> m_HTTP_Handle.setOpt(new cURLpp::Options::Verbose(true));
>
> std::list<std::string> HeaderData;
> HeaderData.push_back("Content-Type: application/octet-stream");
>
> m_HTTP_Handle.setOpt(new cURLpp::Options::HttpHeader(HeaderData));
>
> m_HTTP_Handle.setOpt( new cURLpp::Options::PostFields( pBinaryData
> ) );
> m_HTTP_Handle.setOpt( new cURLpp::Options::PostFieldSize( size ) );
>
> m_HTTP_Handle.perform();
>
> When I send this I see the following in my terminal:
>
> * About to connect() to 192.168.1.101 port 8080
> * Trying 192.168.1.101... * connected
> * Connected to 192.168.1.101 (192.168.1.101) port 8080
> > POST /cdn/simpleServlet HTTP/1.1
> Host: 192.168.1.101:8080
> Pragma: no-cache
> Accept: */*
> Content-Length: 72
> Content-Type: application/x-www-form-urlencoded
>
> Everything is perfect except that I my header is still set to the
> default: "Content-Type: application/x-www-form-urlencoded" instead of what
> I want: "Content-Type: application/octet-stream".
>
> Can anyone see what I am doing wrong (or not doing)?
>
> Thanks for your help,
>
> John
>
>
>

_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2006-03-29

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET