curl_formfree.3 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 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_formfree 3 "6 April 2001" "libcurl" "libcurl"
  25. .SH NAME
  26. curl_formfree - free a previously build multipart form post chain
  27. .SH SYNOPSIS
  28. .nf
  29. #include <curl/curl.h>
  30. void curl_formfree(struct curl_httppost *form);
  31. .fi
  32. .SH DESCRIPTION
  33. This function is deprecated. Do not use. See \fIcurl_mime_init(3)\fP instead!
  34. curl_formfree() is used to clean up data previously built/appended with
  35. \fIcurl_formadd(3)\fP. This must be called when the data has been used, which
  36. typically means after \fIcurl_easy_perform(3)\fP has been called.
  37. The pointer to free is the same pointer you passed to the
  38. \fICURLOPT_HTTPPOST(3)\fP option, which is the \fIfirstitem\fP pointer from
  39. the \fIcurl_formadd(3)\fP invoke(s).
  40. \fBform\fP is the pointer as returned from a previous call to
  41. \fIcurl_formadd(3)\fP and may be NULL.
  42. Passing in a NULL pointer in \fIform\fP will make this function return
  43. immediately with no action.
  44. .SH EXAMPLE
  45. .nf
  46. /* Fill in a file upload field */
  47. curl_formadd(&formpost,
  48. &lastptr,
  49. CURLFORM_COPYNAME, "file",
  50. CURLFORM_FILE, "nice-image.jpg",
  51. CURLFORM_END);
  52. curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
  53. curl_easy_perform(curl);
  54. /* then cleanup the formpost chain */
  55. curl_formfree(formpost);
  56. .fi
  57. .SH AVAILABILITY
  58. Deprecated in 7.56.0.
  59. .SH RETURN VALUE
  60. None
  61. .SH "SEE ALSO"
  62. .BR curl_formadd "(3), " curl_mime_init "(3), " curl_mime_free "(3)"