curl_mime_headers.3 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_headers 3 "22 August 2017" "libcurl 7.56.0" "libcurl Manual"
  25. .SH NAME
  26. curl_mime_headers - set a mime part's custom headers
  27. .SH SYNOPSIS
  28. .nf
  29. #include <curl/curl.h>
  30. CURLcode curl_mime_headers(curl_mimepart *part,
  31. struct curl_slist *headers, int take_ownership);
  32. .fi
  33. .SH DESCRIPTION
  34. \fIcurl_mime_headers(3)\fP sets a mime part's custom headers.
  35. \fIpart\fP is the part's handle to assign the custom headers list to.
  36. \fIheaders\fP is the head of a list of custom headers; it may be set to NULL
  37. to remove a previously attached custom header list.
  38. \fItake_ownership\fP: when non-zero, causes the list to be freed upon
  39. replacement or mime structure deletion; in this case the list must not be
  40. freed explicitly.
  41. Setting a part's custom headers list multiple times is valid: only the value
  42. set by the last call is retained.
  43. .SH EXAMPLE
  44. .nf
  45. struct curl_slist *headers = NULL;
  46. headers = curl_slist_append(headers, "Custom-Header: mooo");
  47. /* use these headers, please take ownership */
  48. curl_mime_headers(part, headers, TRUE);
  49. /* pass on this data */
  50. curl_mime_data(part, "12345679", CURL_ZERO_TERMINATED);
  51. /* set name */
  52. curl_mime_name(part, "numbers");
  53. .fi
  54. .SH AVAILABILITY
  55. As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
  56. .SH RETURN VALUE
  57. CURLE_OK or a CURL error code upon failure.
  58. .SH "SEE ALSO"
  59. .BR curl_mime_addpart "(3)"