curl_formfree.3 2.5 KB

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