curl_mime_name.3 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .TH curl_mime_name 3 "22 August 2017" "libcurl 7.56.0" "libcurl Manual"
  25. .SH NAME
  26. curl_mime_name - set a mime part's name
  27. .SH SYNOPSIS
  28. .nf
  29. #include <curl/curl.h>
  30. CURLcode curl_mime_name(curl_mimepart *part, const char *name);
  31. .fi
  32. .SH DESCRIPTION
  33. \fIcurl_mime_name(3)\fP sets a mime part's name. This is the way HTTP form
  34. fields are named.
  35. \fIpart\fP is the part's handle to assign a name to.
  36. \fIname\fP points to the null-terminated name string.
  37. The name string is copied into the part, thus the associated storage may
  38. safely be released or reused after call. Setting a part's name multiple times
  39. is valid: only the value set by the last call is retained. It is possible to
  40. reset the name of a part by setting \fIname\fP to NULL.
  41. .SH EXAMPLE
  42. .nf
  43. curl_mime *mime;
  44. curl_mimepart *part;
  45. /* create a mime handle */
  46. mime = curl_mime_init(easy);
  47. /* add a part */
  48. part = curl_mime_addpart(mime);
  49. /* give the part a name */
  50. curl_mime_name(part, "shoe_size");
  51. .fi
  52. .SH AVAILABILITY
  53. As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
  54. .SH RETURN VALUE
  55. CURLE_OK or a CURL error code upon failure.
  56. .SH "SEE ALSO"
  57. .BR curl_mime_addpart "(3),"
  58. .BR curl_mime_data "(3),"
  59. .BR curl_mime_type "(3)"