libcurl手册-CURLOPT_WRITEDATA

CURLOPT_WRITEDATA(3) curl_easy_setopt options

CURLOPT_WRITEDATA(3)

NAME

复制代码
   CURLOPT_WRITEDATA - pointer passed to the write callback

SYNOPSIS

cpp 复制代码
#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_WRITEDATA, void *pointer);

DESCRIPTION

复制代码
   A  data  pointer  to  pass  to the write callback. If you use the CURLOPT_WRITEFUNCTION(3) option, this is the
   pointer you will get in that callback's fourth and last argument. If you do not use a write callback, you must
   make pointer a 'FILE *' (cast to 'void *') as libcurl will pass this to fwrite(3) when writing data.

   The  internal  CURLOPT_WRITEFUNCTION(3) will write the data to the FILE * given with this option, or to stdout
   if this option has not been set.

   If you are using libcurl as a win32 DLL, you MUST use a CURLOPT_WRITEFUNCTION(3) if you set this option or you
   will experience crashes.

要注意Win32 DLL下,如果设置了这个选项,就必须设置CURLOPT_WRITEFUNCTION,否则程序会崩溃。

DEFAULT

复制代码
   By default, this is a FILE * to stdout.

PROTOCOLS

复制代码
   Used for all protocols.

EXAMPLE

复制代码
   A  common  technique  is to use the write callback to store the incoming data into a dynamically growing allo‐
   cated buffer, and then this CURLOPT_WRITEDATA(3) is used to point to a struct or the buffer to store data  in.
   Like in the getinmemory example: https://curl.se/libcurl/c/getinmemory.html

AVAILABILITY

复制代码
   Available  in  all  libcurl  versions. This option was formerly known as CURLOPT_FILE, the name CURLOPT_WRITE‐
   DATA(3) was introduced in 7.9.7.

RETURN VALUE

复制代码
   This will return CURLE_OK.

SEE ALSO

复制代码
   CURLOPT_WRITEFUNCTION(3), CURLOPT_READDATA(3),

libcurl 7.88.1 January 02, 2023 CURLOPT_WRITEDATA(3)

相关推荐
广州灵眸科技有限公司11 小时前
瑞芯微(EASY EAI)RV1126B rknn-toolkit-lite2使用方法
linux·网络·人工智能·物联网·算法
张32311 小时前
Ansible实施任务控制
linux·ansible
白菜欣11 小时前
Linux权限
linux·运维·c++
卵男(章鱼)11 小时前
系统终端命令对比大全(Linux发行/macOS/Windows)
linux·运维·服务器·windows·macos
草明11 小时前
Linux主流发行版全面修复Spectre/Meltdown后续漏洞
linux·运维·服务器
HABuo11 小时前
【linux网络(一)】初识网络, 理解协议&四层网络模型&网络传输流程
linux·运维·服务器·网络·c++·ubuntu·centos
SNOWPIAOP11 小时前
从MAC电脑复制qwen3.5:4b 的OLLAMA模型到LINUX电脑实践
linux·运维·macos·manifest·ollama·blobs
Achou.Wang11 小时前
go语言中类型别名和定义类型之间的区别
服务器·golang
cui_ruicheng11 小时前
Linux文件系统(三):VFS 结构与软硬链接详解
linux·运维·服务器
mmWave&THz11 小时前
传统微波IDU与数字IP微波ODU扩展单元(数字微波IDU)技术对比分析
大数据·运维·网络·tcp/ip·系统架构·信息与通信·智能硬件