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)

相关推荐
Agent产品评测局13 分钟前
企业发票管理自动化落地,验真归档全流程实现方法:2026企业级智能体选型与实测指南
运维·网络·人工智能·ai·chatgpt·自动化
wwj888wwj19 分钟前
Ansible基础(复习1)
linux·运维·ansible
DYuW5gBmH24 分钟前
Anthropic 开源 Bloom:基于 LLM 的自动化行为评估框架
运维·microsoft·自动化
yj_xqj30 分钟前
Linux network启动报错 && nmcli 的使用
linux·运维·服务器
程序猿编码38 分钟前
eBPF代理:让SSH进程“溯源”,找到背后的客户端IP
linux·tcp/ip·ssh·ebpf
Shepherd061942 分钟前
【IT 实战】解决 TP-Link USB 无线网卡在 Linux/PVE 下识别为存储设备的问题
linux·运维·服务器
认真的薛薛1 小时前
GPU运维:vllm启动大模型参数解析
运维·数据库·vllm
开开心心_Every1 小时前
免费轻量电子书阅读器,多系统记笔记听书
linux·运维·服务器·神经网络·安全·机器学习·pdf
存储服务专家StorageExpert1 小时前
DELL EMC isilon/PowerScale 存储的健康检查方法
linux·运维·服务器·netapp存储·emc存储
熊文豪1 小时前
当系统在后台偷偷“记账“:KES 性能观测体系深度解析
linux·运维·服务器·数据库