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)

相关推荐
java_logo10 分钟前
Docker 部署 WordPress 全流程
运维·docker·容器·word·php·1024程序员节
小小的木头人17 分钟前
Ubuntu 自动挂载移动硬盘
运维
DeeplyMind18 分钟前
AMD rocr-libhsakmt分析系列3-4:svm-reserve模式实现分析
linux·驱动开发·1024程序员节·amdgpu·kfd·rocr
神秘的土鸡19 分钟前
从数据仓库到数据中台再到数据飞轮:我的数据技术成长之路
java·服务器·aigc·数据库架构·1024程序员节
大米粥哥哥37 分钟前
Qt QProcess基于Linux的命令管道符号无效问题【已解决】
linux·qt·shell·qprocess·1024程序员节·管道符号
Mr. Sun_1 小时前
Dell Networking SmartFabric OS10 如何设置虚拟链路中继 (VLT)
运维·网络·dell vlt
北京迅为1 小时前
【北京迅为】iTOP-4412精英版使用手册-第六十七章 USB鼠标驱动详解
linux·人工智能·嵌入式·4412
骑士9991111 小时前
rabbitMQ 的安装和使用
linux·rabbitmq
小白不想白a1 小时前
【shell】每日shell练习:系统备份文件管理/系统性能趋势分析
linux·服务器
咬_咬2 小时前
C++仿muduo库高并发服务器项目:Channel模块
linux·c++·channel·1024程序员节·muduo·高并发服务器