1curl_formfree(3)                libcurl Manual                curl_formfree(3)
2
3
4

NAME

6       curl_formfree  -  free  a previously build multipart/formdata HTTP POST
7       chain
8

SYNOPSIS

10       #include <curl/curl.h>
11
12       void curl_formfree(struct curl_httppost *form);
13

DESCRIPTION

15       This function is deprecated. Do not use. See curl_mime_init(3) instead!
16
17       curl_formfree() is used to clean up data previously built/appended with
18       curl_formadd(3). This must be called when the data has been used, which
19       typically means after curl_easy_perform(3) has been called.
20
21       The pointer to free is the same pointer you passed to the CURLOPT_HTTP‐
22       POST(3) option, which is the firstitem pointer from the curl_formadd(3)
23       invoke(s).
24
25       form is the pointer as returned from a previous call to curl_formadd(3)
26       and may be NULL.
27
28       Passing  in a NULL pointer in form will make this function return imme‐
29       diately with no action.
30

EXAMPLE

32         /* Fill in a file upload field */
33         curl_formadd(&formpost,
34                      &lastptr,
35                      CURLFORM_COPYNAME, "file",
36                      CURLFORM_FILE, "nice-image.jpg",
37                      CURLFORM_END);
38
39         curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
40
41         curl_easy_perform(curl);
42
43         /* then cleanup the formpost chain */
44         curl_formfree(formpost);
45

AVAILABILITY

47       Deprecated in 7.56.0.
48

RETURN VALUE

50       None
51

SEE ALSO

53       curl_formadd(3), curl_mime_init(3), curl_mime_free(3)
54
55
56
57libcurl 7.85.0                   May 17, 2022                 curl_formfree(3)
Impressum