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] PostFieldSize in curlpp/libcurl

From: Piotr Dobrogost <curlpp_at_2008.autoera.pl>
Date: Mon, 17 Nov 2008 19:49:58 +0100

Jean

In example 12 you have this

request.setOpt(new cURLpp::Options::PostFields("abcd"));
request.setOpt(new cURLpp::Options::PostFieldSize(5));

Why is PostFieldSize set to 5? Do you have to take into account null terminated string used by libcurl?

And do you know why in libcurl's tutorial (http://curl.haxx.se/libcurl/c/libcurl-tutorial.html) in this example

struct curl_slist *headers=NULL;
headers = curl_slist_append(headers, "Content-Type: text/xml");

/* post binary data */
curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDS, binaryptr);

/* set the size of the postfields data */
curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDSIZE, 23L);

/* pass our list of custom made headers */
curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, headers);

curl_easy_perform(easyhandle); /* post away! */

curl_slist_free_all(headers); /* free the header list */

they set CURLOPT_POSTFIELDSIZE to 23? They don't show in this example the data pointed to by binaryptr.
Strange enough the length of Content-Type header is exactly 23 but this is only a coincidence, isn't it?

Regards
Piotr Dobrogost
_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2008-11-17

These mail archives are generated by hypermail.

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

File upload with ASP.NET