curl/docs/libcurl/opts/CURLOPT_TRAILERDATA.md
Daniel Stenberg 5a488251f7
curldown: fixups
- make DEFAULT sections less repetitive

- make historic mentions use HISTORY

- generate the protocols section on `# %PROTOCOLS%` instead of guessing
  where to put it

- generate the availability section on `# %AVAILABILITY%` instead of
  guessing where to put it

- make the protocols section more verbose

Closes #14227
2024-07-19 17:03:25 +02:00

825 B

c SPDX-License-Identifier Title Section Source See-also Protocol Added-in
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. curl CURLOPT_TRAILERDATA 3 libcurl
CURLOPT_TRAILERFUNCTION (3)
CURLOPT_WRITEFUNCTION (3)
HTTP
7.64.0

NAME

CURLOPT_TRAILERDATA - pointer passed to trailing headers callback

SYNOPSIS

#include <curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRAILERDATA, void *userdata);

DESCRIPTION

Data pointer to be passed to the HTTP trailer callback function.

DEFAULT

NULL

%PROTOCOLS%

EXAMPLE

struct MyData {
  void *custom;
};

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    struct MyData data;
    curl_easy_setopt(curl, CURLOPT_TRAILERDATA, &data);
  }
}

%AVAILABILITY%

RETURN VALUE

Returns CURLE_OK.