summaryrefslogtreecommitdiff
path: root/docs/libcurl/curl_mime_data.3
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-09-05 11:14:42 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-09-05 11:15:02 +0200
commiteae21db920b19ed0729196165f0abf54749cf6db (patch)
treee8e22ff67f702b1518aac83a4f662a56690afc8b /docs/libcurl/curl_mime_data.3
parent889723b004667abc061f9a23e928aba064b7f2a0 (diff)
downloadcurl-eae21db920b19ed0729196165f0abf54749cf6db.tar.gz
docs/curl_mime_*.3: added examples
Diffstat (limited to 'docs/libcurl/curl_mime_data.3')
-rw-r--r--docs/libcurl/curl_mime_data.314
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/libcurl/curl_mime_data.3 b/docs/libcurl/curl_mime_data.3
index c458f2d38..1b6ac235c 100644
--- a/docs/libcurl/curl_mime_data.3
+++ b/docs/libcurl/curl_mime_data.3
@@ -48,6 +48,20 @@ Setting very large data is memory consuming: one might consider using
As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
.SH RETURN VALUE
CURLE_OK or a CURL error code upon failure.
+.SH EXAMPLE
+.nf
+ struct curl_mime *mime;
+ struct mimepart *part;
+
+ /* create a mime handle */
+ mime = curl_mime_init(easy);
+
+ /* add a part */
+ part = curl_mime_addpart(mime);
+
+ /* add data to the part */
+ curl_mime_data(part, "raw contents to send", CURL_ZERO_TERMINATED);
+.fi
.SH "SEE ALSO"
.BR curl_mime_addpart "(3),"
.BR curl_mime_data_cb "(3)"