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, struct curl_slist *
12       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
23       replacement or mime structure deletion; in this case the list must  not
24       be freed explicitly.
25
26       Setting a part's custom headers list twice is valid: only the value set
27       by the last call is retained.
28

AVAILABILITY

30       As long as at least one of HTTP, SMTP or  IMAP  is  enabled.  Added  in
31       7.56.0.
32

RETURN VALUE

34       CURLE_OK or a CURL error code upon failure.
35

EXAMPLE

37        struct curl_slist *headers = NULL;
38
39        headers = curl_slist_append("Custom-Header: mooo", headers);
40
41        /* use these headers, please take ownership */
42        curl_mime_headers(part, headers, TRUE);
43
44        /* pass on this data */
45        curl_mime_data(part, "12345679", CURL_ZERO_TERMINATED);
46
47        /* set name */
48        curl_mime_name(part, "numbers");
49

SEE ALSO

51       curl_mime_addpart(3)
52
53
54
55libcurl 7.69.1                September 22, 2017          curl_mime_headers(3)
Impressum