curl_mime_headers.3 2.4 KB

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