cURL / Mailing Lists / curl-library / Single Mail

curl-library

post binary data using curlopt_postfields option

From: Vemana Yogi <yogi.elgoog_at_gmail.com>
Date: Tue, 8 Jun 2010 23:03:08 -0700

Hi,

   Can we post binary data with the below curl options:

curl_easy_setopt(handle, CURLOPT_POSTFIELDS, buff);
curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE, bs->size());

?

An inline question if the answer to the above query is yes - I came across a
page which I am not able to find now. It said, we have to pass a binary
pointer in place of what I put in as buff - if I understand this right, this
is just const char * right?

What I am currently doing is encoding a string into binary, and would like
to post this encoding binary data to the services. So in my case the buff
is a custom buffer stream pointer.

thanks
Yogi

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-06-09