curl_mime_name.3 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. .\" generated by cd2nroff 0.1 from curl_mime_name.md
  2. .TH curl_mime_name 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_mime_name \- set a mime part\(aqs name
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_mime_name(curl_mimepart *part, const char *name);
  9. .fi
  10. .SH DESCRIPTION
  11. \fIcurl_mime_name(3)\fP sets a mime part\(aqs name. This is the way HTTP form
  12. fields are named.
  13. \fIpart\fP is the part\(aqs handle to assign a name to.
  14. \fIname\fP points to the null\-terminated name string.
  15. The name string is copied into the part, thus the associated storage may
  16. safely be released or reused after call. Setting a part\(aqs name multiple times
  17. is valid: only the value set by the last call is retained. It is possible to
  18. reset the name of a part by setting \fIname\fP to NULL.
  19. .SH PROTOCOLS
  20. This functionality affects http, imap and smtp
  21. .SH EXAMPLE
  22. .nf
  23. int main(void)
  24. {
  25. curl_mime *mime;
  26. curl_mimepart *part;
  27. CURL *curl = curl_easy_init();
  28. if(curl) {
  29. /* create a mime handle */
  30. mime = curl_mime_init(curl);
  31. /* add a part */
  32. part = curl_mime_addpart(mime);
  33. /* give the part a name */
  34. curl_mime_name(part, "shoe_size");
  35. }
  36. }
  37. .fi
  38. .SH AVAILABILITY
  39. Added in curl 7.56.0
  40. .SH RETURN VALUE
  41. CURLE_OK or a CURL error code upon failure.
  42. .SH SEE ALSO
  43. .BR curl_mime_addpart (3),
  44. .BR curl_mime_data (3),
  45. .BR curl_mime_type (3)