---
name: "CURLOPT_TRAILERDATA"
section: "3"
platform: "macos"
package: "curl"
version: "166.0.0.0.1"
release: "macOS 26.5"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/CURLOPT_TRAILERDATA"
---

# CURLOPT\_TRAILERDATA(3)

pointer passed to trailing headers callback

## 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

HTTP

## 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

This option was added in curl 7.64.0 and is present if HTTP support is enabled

## RETURN VALUE

Returns CURLE\_OK.

## SEE ALSO

[**CURLOPT\_TRAILERFUNCTION**(3)](/CURLOPT_TRAILERFUNCTION/3.md), [**CURLOPT\_WRITEFUNCTION**(3)](/CURLOPT_WRITEFUNCTION/3.md)
