1curl_mime_headers(3)            libcurl Manual            curl_mime_headers(3)
2
3
4

NAME

6       curl_mime_headers - set a mime part's custom headers
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_mime_headers(curl_mimepart *part,
12                                  struct curl_slist *headers, int take_ownership);
13

DESCRIPTION

15       curl_mime_headers(3) sets a mime part's custom headers.
16
17       part is the part's handle to assign the custom headers list to.
18
19       headers  is the head of a list of custom headers; it may be set to NULL
20       to remove a previously attached custom header list.
21
22       take_ownership: when non-zero, causes the list to  be  freed  upon  re‐
23       placement or mime structure deletion; in this case the list must not be
24       freed explicitly.
25
26       Setting a part's custom headers list multiple times is valid: only  the
27       value set by the last call is retained.
28

EXAMPLE

30        struct curl_slist *headers = NULL;
31
32        headers = curl_slist_append(headers, "Custom-Header: mooo");
33
34        /* use these headers, please take ownership */
35        curl_mime_headers(part, headers, TRUE);
36
37        /* pass on this data */
38        curl_mime_data(part, "12345679", CURL_ZERO_TERMINATED);
39
40        /* set name */
41        curl_mime_name(part, "numbers");
42

AVAILABILITY

44       As  long  as  at  least  one of HTTP, SMTP or IMAP is enabled. Added in
45       7.56.0.
46

RETURN VALUE

48       CURLE_OK or a CURL error code upon failure.
49

SEE ALSO

51       curl_mime_addpart(3)
52
53
54
55libcurl 7.85.0                   May 17, 2022             curl_mime_headers(3)
Impressum