Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there in C API for PHP's CURLOPT_RETURNTRANSFER?

Tags:

c

php

curl

libcurl

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.

like image 279
Rella Avatar asked Jul 17 '11 22:07

Rella


People also ask

What is curl_ setopt in PHP?

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.

What is Curlopt_returntransfer in curl?

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"


1 Answers

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.

like image 68
hakre Avatar answered Oct 19 '22 23:10

hakre