繁体   English   中英

C API 中是否有 PHP 的 CURLOPT_RETURNTRANSFER?

[英]Is there in C API for PHP's CURLOPT_RETURNTRANSFER?

在 PHP API 中,我们可以使用curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 但如何将其翻译成 C? 我试过curl_easy_setopt(curl_handle, CURLOPT_RETURNTRANSFER, true); 但失败了。

libcurl C API 中没有CURLOPT_RETURNTRANSFER 您可以通过回调 function 来做到这一点,它是libcurls 示例之一:仅在 memory 中获取远程文件

我认为这个邮件列表条目是相关的:

http://curl.haxx.se/mail/curlphp-2009-11/0005.html

CURLOPT_RETURNTRANSFER 由 PHP 绑定作者发明,基本上只是将所有接收到的数据附加到 memory 缓冲区的快捷方式。 With the C API and basically all existing bindings as well (including the PHP one) you can use a write callback to append all data to a single buffer.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM