2014-06-17 05:01:12 +08:00
|
|
|
.\" **************************************************************************
|
|
|
|
.\" * _ _ ____ _
|
|
|
|
.\" * Project ___| | | | _ \| |
|
|
|
|
.\" * / __| | | | |_) | |
|
|
|
|
.\" * | (__| |_| | _ <| |___
|
|
|
|
.\" * \___|\___/|_| \_\_____|
|
|
|
|
.\" *
|
2023-01-02 20:51:48 +08:00
|
|
|
.\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2014-06-17 05:01:12 +08:00
|
|
|
.\" *
|
|
|
|
.\" * This software is licensed as described in the file COPYING, which
|
|
|
|
.\" * you should have received as part of this distribution. The terms
|
2020-11-04 21:02:01 +08:00
|
|
|
.\" * are also available at https://curl.se/docs/copyright.html.
|
2014-06-17 05:01:12 +08:00
|
|
|
.\" *
|
|
|
|
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
.\" * copies of the Software, and permit persons to whom the Software is
|
|
|
|
.\" * furnished to do so, under the terms of the COPYING file.
|
|
|
|
.\" *
|
|
|
|
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
.\" * KIND, either express or implied.
|
|
|
|
.\" *
|
|
|
|
.\" * SPDX-License-Identifier: curl
|
2022-05-17 17:16:50 +08:00
|
|
|
.\" *
|
2014-06-17 05:01:12 +08:00
|
|
|
.\" **************************************************************************
|
|
|
|
.\"
|
2023-04-26 14:58:35 +08:00
|
|
|
.TH CURLOPT_READDATA 3 "16 Jun 2014" libcurl libcurl
|
2014-06-17 05:01:12 +08:00
|
|
|
.SH NAME
|
2021-11-09 01:08:47 +08:00
|
|
|
CURLOPT_READDATA \- pointer passed to the read callback
|
2014-06-17 05:01:12 +08:00
|
|
|
.SH SYNOPSIS
|
2021-11-26 21:20:18 +08:00
|
|
|
.nf
|
2014-06-17 05:01:12 +08:00
|
|
|
#include <curl/curl.h>
|
|
|
|
|
|
|
|
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_READDATA, void *pointer);
|
2021-11-26 21:20:18 +08:00
|
|
|
.fi
|
2014-06-17 05:01:12 +08:00
|
|
|
.SH DESCRIPTION
|
|
|
|
Data \fIpointer\fP to pass to the file read function. If you use the
|
2023-08-22 23:40:39 +08:00
|
|
|
\fICURLOPT_READFUNCTION(3)\fP option, this is the pointer you get as input in
|
|
|
|
the fourth argument to the callback.
|
2014-06-17 05:01:12 +08:00
|
|
|
|
2021-10-31 23:34:44 +08:00
|
|
|
If you do not specify a read callback but instead rely on the default internal
|
2014-06-17 05:01:12 +08:00
|
|
|
read function, this data must be a valid readable FILE * (cast to 'void *').
|
|
|
|
|
2023-08-22 23:40:39 +08:00
|
|
|
If you are using libcurl as a DLL on Windows, you must use the
|
|
|
|
\fICURLOPT_READFUNCTION(3)\fP callback if you set this option, otherwise you
|
|
|
|
might experience crashes.
|
2014-06-17 05:01:12 +08:00
|
|
|
.SH DEFAULT
|
|
|
|
By default, this is a FILE * to stdin.
|
|
|
|
.SH PROTOCOLS
|
2014-06-17 06:46:32 +08:00
|
|
|
This is used for all protocols when sending data.
|
2014-06-17 05:01:12 +08:00
|
|
|
.SH EXAMPLE
|
2015-03-17 15:03:46 +08:00
|
|
|
.nf
|
|
|
|
CURL *curl = curl_easy_init();
|
|
|
|
struct MyData this;
|
|
|
|
if(curl) {
|
2020-09-17 05:04:07 +08:00
|
|
|
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
2015-03-17 15:03:46 +08:00
|
|
|
|
|
|
|
/* pass pointer that gets passed in to the
|
|
|
|
CURLOPT_READFUNCTION callback */
|
|
|
|
curl_easy_setopt(curl, CURLOPT_READDATA, &this);
|
|
|
|
|
|
|
|
curl_easy_perform(curl);
|
|
|
|
}
|
|
|
|
.fi
|
2014-06-17 05:01:12 +08:00
|
|
|
.SH AVAILABILITY
|
2016-05-01 22:41:04 +08:00
|
|
|
This option was once known by the older name CURLOPT_INFILE, the name
|
2016-04-18 06:02:29 +08:00
|
|
|
\fICURLOPT_READDATA(3)\fP was introduced in 7.9.7.
|
2014-06-17 05:01:12 +08:00
|
|
|
.SH RETURN VALUE
|
2023-08-22 23:40:39 +08:00
|
|
|
This returns CURLE_OK.
|
2014-06-17 05:01:12 +08:00
|
|
|
.SH "SEE ALSO"
|
2023-09-27 05:25:11 +08:00
|
|
|
.BR CURLOPT_HEADERDATA (3),
|
|
|
|
.BR CURLOPT_READFUNCTION (3),
|
|
|
|
.BR CURLOPT_WRITEDATA (3),
|
|
|
|
.BR CURLOPT_WRITEFUNCTION (3)
|