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)

相关推荐
春日见3 分钟前
TEST文件夹:Pytest,集成测试,单元测试
服务器·人工智能·驱动开发·单元测试·计算机外设·集成测试·pytest
riNt PTIP10 分钟前
RustDesk搭建公网中继服务器远控内网机器(完整版)
运维·服务器
进击的码力13 分钟前
/dev/nume0n1p2导致ubuntu系统无法启动
linux·运维·ubuntu
激昂网络21 分钟前
在Ubuntu 24.04上编译T527 Android系统:遇到的几个问题及解决方法
android·linux·ubuntu
安科士andxe21 分钟前
实践指南|安科士SFP-10/25G-LR-S-I光模块部署与运维技巧
运维·人工智能·5g
不愿透露姓名的大鹏22 分钟前
VMware vSphere开通用户和分配权限
linux·运维·服务器·vmware
-ONLY-¥30 分钟前
MySQL故障排查与性能优化实战
linux
Calebbbbb43 分钟前
使用 Android Emulator 针对 AOSP 单测编译运行并检查覆盖率的完整实践
android·linux·安卓
童话的守望者1 小时前
matrix-breakout-2-morpheus靶机通关
linux·运维·服务器
Frank_refuel1 小时前
Linux操作系统 -> 进程信号(上)
linux·运维·服务器