mirror of
https://github.com/curl/curl.git
synced 2026-08-24 22:43:38 +03:00
mime: use CURL_ZERO_TERMINATED in examples
and some minor whitespace fixes
This commit is contained in:
parent
202c1cc22f
commit
841a09ea19
6 changed files with 19 additions and 19 deletions
|
|
@ -142,7 +142,7 @@ int seek_callback(void *arg, curl_off_t offset, int origin)
|
|||
p->position = offset;
|
||||
return CURL_SEEKFUNC_OK;
|
||||
}
|
||||
|
||||
|
||||
CURL *easy = curl_easy_init();
|
||||
curl_mime *mime = curl_mime_init(easy);
|
||||
curl_mimepart *part = curl_mime_addpart(mime);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ subsequently filled using the mime API, then attached to \fIeasy_handle\fP
|
|||
using option \fICURLOPT_MIMEPOST(3)\fP within a \fIcurl_easy_setopt(3)\fP
|
||||
call.
|
||||
|
||||
Using a mime handle is the recommended way to post an HTTP form, format and
|
||||
Using a mime handle is the recommended way to post an HTTP form, format and
|
||||
send a multi-part e-mail with SMTP or upload such an e-mail to an IMAP server.
|
||||
|
||||
.SH AVAILABILITY
|
||||
|
|
@ -51,8 +51,8 @@ A mime struct handle, or NULL upon failure.
|
|||
/* Build an HTTP form with a single field named "data", */
|
||||
mime = curl_mime_init(easy);
|
||||
part = curl_mime_addpart(mime);
|
||||
curl_mime_data(part, "This is the field data", -1);
|
||||
curl_mime_name(part, "data", -1);
|
||||
curl_mime_data(part, "This is the field data", CURL_ZERO_TERMINATED);
|
||||
curl_mime_name(part, "data", CURL_ZERO_TERMINATED);
|
||||
|
||||
/* Post and send it. */
|
||||
curl_easy_setopt(easy, CURLOPT_MIMEPOST, mime);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue