cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Sending binary data through CURL

From: Yehezkel Horowitz <horowity_at_checkpoint.com>
Date: Thu, 19 Dec 2013 13:40:30 +0000

> Say std::string binaryData = "SOME BINARY DATA"
> Now, how can I post binaryData to http server through CURL ?
use CURLOPT_READFUNCTION.
You will need to copy the binary data to curl's buffer (e.g. with memcpy).
Pay attention to respect curl's buffer size, and to be able to "rewind" in case curl ask you for with CURLOPT_IOCTLFUNCTION or CURLOPT_SEEKFUNCTION.

HTH

Yehezkel Horowitz

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-12-19