1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_TRAILERDATA
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_TRAILERFUNCTION (3)
9  - CURLOPT_WRITEFUNCTION (3)
10Protocol:
11  - HTTP
12---
13
14# NAME
15
16CURLOPT_TRAILERDATA - pointer passed to trailing headers callback
17
18# SYNOPSIS
19
20~~~c
21#include <curl.h>
22
23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRAILERDATA, void *userdata);
24~~~
25
26# DESCRIPTION
27
28Data pointer to be passed to the HTTP trailer callback function.
29
30# DEFAULT
31
32NULL
33
34# EXAMPLE
35
36~~~c
37struct MyData {
38  void *custom;
39};
40
41int main(void)
42{
43  CURL *curl = curl_easy_init();
44  if(curl) {
45    struct MyData data;
46    curl_easy_setopt(curl, CURLOPT_TRAILERDATA, &data);
47  }
48}
49~~~
50
51# AVAILABILITY
52
53This option was added in curl 7.64.0 and is present if HTTP support is enabled
54
55# RETURN VALUE
56
57Returns CURLE_OK.
58