quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

curl_formfree.md (1691B)


      1 ---
      2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      3 SPDX-License-Identifier: curl
      4 Title: curl_formfree
      5 Section: 3
      6 Source: libcurl
      7 See-also:
      8   - curl_formadd (3)
      9   - curl_mime_free (3)
     10   - curl_mime_init (3)
     11 Protocol:
     12   - HTTP
     13 Added-in: 7.1
     14 ---
     15 
     16 # NAME
     17 
     18 curl_formfree - free a previously build multipart form post chain
     19 
     20 # SYNOPSIS
     21 
     22 ~~~c
     23 #include <curl/curl.h>
     24 
     25 void curl_formfree(struct curl_httppost *form);
     26 ~~~
     27 
     28 # DESCRIPTION
     29 
     30 This function is deprecated. Do not use. See curl_mime_init(3) instead.
     31 
     32 curl_formfree() is used to clean up data previously built/appended with
     33 curl_formadd(3). This must be called when the data has been used, which
     34 typically means after curl_easy_perform(3) has been called.
     35 
     36 The pointer to free is the same pointer you passed to the
     37 CURLOPT_HTTPPOST(3) option, which is the *firstitem* pointer from
     38 the curl_formadd(3) invoke(s).
     39 
     40 **form** is the pointer as returned from a previous call to
     41 curl_formadd(3) and may be NULL.
     42 
     43 Passing in a NULL pointer in *form* makes this function return immediately
     44 with no action.
     45 
     46 # %PROTOCOLS%
     47 
     48 # EXAMPLE
     49 
     50 ~~~c
     51 int main(void)
     52 {
     53   CURL *curl = curl_easy_init();
     54   if(curl) {
     55     struct curl_httppost *formpost;
     56     struct curl_httppost *lastptr;
     57 
     58     /* Fill in a file upload field */
     59     curl_formadd(&formpost,
     60                  &lastptr,
     61                  CURLFORM_COPYNAME, "file",
     62                  CURLFORM_FILE, "nice-image.jpg",
     63                  CURLFORM_END);
     64 
     65     curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
     66 
     67     curl_easy_perform(curl);
     68 
     69     /* then cleanup the formpost chain */
     70     curl_formfree(formpost);
     71   }
     72 }
     73 ~~~
     74 
     75 # DEPRECATED
     76 
     77 Deprecated in 7.56.0.
     78 
     79 # %AVAILABILITY%
     80 
     81 # RETURN VALUE
     82 
     83 None