cURL / Mailing Lists / curl-library / Single Mail


RE: How to retrieve webpage from curl_easy_perform

From: Patrick Monnerat <>
Date: Tue, 3 Mar 2015 17:40:04 +0100

Josh Angstadt wrote:
> curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
> curl_easy_setopt(curl, CURLOPT_READDATA, result);

Your program is supposed to DOWNLOAD, isn't it ?

The specifies:

CURLOPT_READFUNCTION - read callback for data UPLOADS.

You probably need to use instead.

If you just want to write received data to a file, use CURLOPT_WRITEDATA
with the preopened FILE * (CURLOPT_WRITEFUNCTION is set to fwrite by
If you want to process data before writing it somewhere, please see

List admin:
Received on 2015-03-03