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

NAME

6       curl_mime_addpart - append a new empty part to a mime structure
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       curl_mimepart * curl_mime_addpart(curl_mime * mime);
12

DESCRIPTION

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
16       can 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

AVAILABILITY

22       As long as at least one of HTTP, SMTP or  IMAP  is  enabled.  Added  in
23       7.56.0.
24

RETURN VALUE

26       A mime part structure handle, or NULL upon failure.
27

EXAMPLE

29        curl_mime *mime;
30        curl_mimepart *part;
31
32        /* create a mime handle */
33        mime = curl_mime_init(easy);
34
35        /* add a part */
36        part = curl_mime_addpart(mime);
37
38        /* continue and set name + data to the part */
39        curl_mime_data(part, "This is the field data", CURL_ZERO_TERMINATED);
40        curl_mime_name(part, "data");
41

SEE ALSO

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 7.76.1                 November 05, 2020          curl_mime_addpart(3)
Impressum