In PHP API we could use curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
but how to translate it into C? I tried curl_easy_setopt(curl_handle, CURLOPT_RETURNTRANSFER, true);
but failed.
The curl_setopt() function will set options for a CURL session identified by the ch parameter. The option parameter is the option you want to set, and the value is the value of the option given by the option.
CURLOPT_RETURNTRANSFER: Converts output to a string rather than directly to the screen. CURLOPT_HTTPHEADER: Request header information with an array of parameters, as shown in the example of "Browser-based redirection"
There's no CURLOPT_RETURNTRANSFER
in libcurl C API. You can do that with a callback function, it's one of libcurls examples: get a remote file in memory only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With