1curl_mime_name(3) libcurl Manual curl_mime_name(3)
2
3
4
6 curl_mime_name - set a mime part's name
7
9 #include <curl/curl.h>
10
11 CURLcode curl_mime_name(curl_mimepart *part, const char *name);
12
14 curl_mime_name(3) sets a mime part's name. This is the way HTTP form
15 fields are named.
16
17 part is the part's handle to assign a name to.
18
19 name points to the null-terminated name string.
20
21 The name string is copied into the part, thus the associated storage
22 may safely be released or reused after call. Setting a part's name mul‐
23 tiple times is valid: only the value set by the last call is retained.
24 It is possible to "unname" a part by setting name to NULL.
25
27 curl_mime *mime;
28 curl_mimepart *part;
29
30 /* create a mime handle */
31 mime = curl_mime_init(easy);
32
33 /* add a part */
34 part = curl_mime_addpart(mime);
35
36 /* give the part a name */
37 curl_mime_name(part, "shoe_size");
38
40 As long as at least one of HTTP, SMTP or IMAP is enabled. Added in
41 7.56.0.
42
44 CURLE_OK or a CURL error code upon failure.
45
47 curl_mime_addpart(3), curl_mime_data(3), curl_mime_type(3)
48
49
50
51libcurl 7.85.0 May 17, 2022 curl_mime_name(3)