cURL / Mailing Lists / curl-library / Single Mail


Re: libcurl with gmail.

From: Fabian Frank <>
Date: Sat, 25 Jan 2014 16:58:02 -0800

On Sat, Jan 25, 2014 at 4:39 PM, Corey Feldman-Haim

> I'm using Qt so I have some code like:
> [code]
> QString qstr = QString(tr("I want to output %1").arg(whatIWantToOutput));
> [/code]
> Basically what I need is to set payload_text to contain qstr, this would be easy if payload_text was const char * but it's a a const char * array and I'm a little confused on how to go from a string to a const char pointer array.
The idea of CURLOPT_READFUNCTION is that you can implement your own
function that reads from whatever payload source you are using. The read
function in the example is for the (artificial) use case of your data
source being a char*[]. Since your payload comes as QString, it will be
easier to write your own version of the payload_source function that can
read from a QString as opposed to trying to fit your QString into a
char*[]. See
for details on how your QString read function should behave.


List admin:
Received on 2014-01-26