1 .\" **************************************************************************
3 .\" * Project ___| | | | _ \| |
4 .\" * / __| | | | |_) | |
5 .\" * | (__| |_| | _ <| |___
6 .\" * \___|\___/|_| \_\_____|
8 .\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
21 .\" **************************************************************************
22 .TH curl_mime_headers 3 "September 22, 2017" "libcurl 7.59.0" "libcurl Manual"
25 curl_mime_headers - set a mime part's custom headers
27 .B #include <curl/curl.h>
29 .BI "CURLcode curl_mime_headers(curl_mimepart * " part ,
30 .BI "struct curl_slist * " headers ", int " take_ownership ");"
33 \fIcurl_mime_headers(3)\fP sets a mime part's custom headers.
35 \fIpart\fP is the part's handle to assign the custom headers list to.
37 \fIheaders\fP is the head of a list of custom headers; it may be set to NULL
38 to remove a previously attached custom header list.
40 \fItake_ownership\fP: when non-zero, causes the list to be freed upon
41 replacement or mime structure deletion; in this case the list must not be
44 Setting a part's custom headers list twice is valid: only the value set by
45 the last call is retained.
47 As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
49 CURLE_OK or a CURL error code upon failure.
52 struct curl_slist *headers = NULL;
54 headers = curl_slist_append("Custom-Header: mooo", headers);
56 /* use these headers, please take ownership */
57 curl_mime_headers(part, headers, TRUE);
59 /* pass on this data */
60 curl_mime_data(part, "12345679", CURL_ZERO_TERMINATED);
63 curl_mime_name(part, "numbers");
66 .BR curl_mime_addpart "(3)"