1curl_mime_addpart(3) libcurl curl_mime_addpart(3)
2
3
4
6 curl_mime_addpart - append a new empty part to a mime structure
7
9 #include <curl/curl.h>
10
11 curl_mimepart *curl_mime_addpart(curl_mime *mime);
12
14 curl_mime_addpart(3) creates and appends a new empty part to the given
15 mime structure and returns a handle to it. The returned part handle can
16 subsequently be populated using functions from the mime API.
17
18 mime is the handle of the mime structure in which the new part must be
19 appended.
20
22 curl_mime *mime;
23 curl_mimepart *part;
24
25 /* create a mime handle */
26 mime = curl_mime_init(easy);
27
28 /* add a part */
29 part = curl_mime_addpart(mime);
30
31 /* continue and set name + data to the part */
32 curl_mime_data(part, "This is the field data", CURL_ZERO_TERMINATED);
33 curl_mime_name(part, "data");
34
36 As long as at least one of HTTP, SMTP or IMAP is enabled. Added in
37 7.56.0.
38
40 A mime part structure handle, or NULL upon failure.
41
43 curl_mime_init(3), curl_mime_name(3), curl_mime_data(3),
44 curl_mime_data_cb(3), curl_mime_filedata(3), curl_mime_filename(3),
45 curl_mime_subparts(3), curl_mime_type(3), curl_mime_headers(3),
46 curl_mime_encoder(3)
47
48
49
50libcurl 8.2.1 April 26, 2023 curl_mime_addpart(3)