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

NAME

6       curl_formfree - free a previously build multipart form post chain
7

SYNOPSIS

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

DESCRIPTION

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

EXAMPLE

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

AVAILABILITY

46       Deprecated in 7.56.0.
47

RETURN VALUE

49       None
50

SEE ALSO

52       curl_formadd(3), curl_mime_init(3), curl_mime_free(3)
53
54
55
56libcurl 8.2.1                   April 26, 2023                curl_formfree(3)
Impressum