curl_mime_addpart(3)

πŸŽ€ curl_mime_addpart(3) πŸŽ€

okay so bestie, this page is from the Library Functions Manual, and it is literally about adding a brand-new empty part to your mime situation πŸ’…


✨ NAME ✨

curl_mime_addpart β€” append a new empty part to a mime structure 🫢


🌸 SYNOPSIS 🌸

#include <curl/curl.h>

curl_mimepart *curl_mime_addpart(curl_mime *mime);

πŸ’– DESCRIPTION πŸ’–

curl_mime_addpart(3) creates and appends a new empty part to the given mime structure and returns a handle to it. The returned part handle can subsequently be populated using functions from the mime API. slay ✨

mime is the handle of the mime structure in which the new part must be appended. yes bestie, that is the whole assignment πŸ’…


πŸ¦‹ PROTOCOLS πŸ¦‹

This functionality affects http, imap and smtp πŸ‘‘


🌈 EXAMPLE 🌈

here is the example, served fresh and unchanged 😌

int main(void)
{
  curl_mime *mime;
  curl_mimepart *part;

  CURL *curl = curl_easy_init();
  if(curl) {
    /* create a mime handle */
    mime = curl_mime_init(curl);

    /* add a part */
    part = curl_mime_addpart(mime);

    /* continue and set name + data to the part */
    curl_mime_data(part, "This is the field data", CURL_ZERO_TERMINATED);
    curl_mime_name(part, "data");
  }
}

🧚 AVAILABILITY 🧚

Added in curl 7.56.0 ⭐


πŸ’œ RETURN VALUE πŸ’œ

A mime part structure handle, or NULL upon failure. and that is the tea β˜•


πŸ”₯ SEE ALSO πŸ”₯


mwah πŸ’‹ this iconic little page comes from libcurl, dated 2026-10-12, under the manual name curl_mime_addpart(3) β€” periodt πŸ’–βœ¨

πŸ“¦ where this page comes from