Imported Upstream version 7.44.0
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_HTTPPOST.html
index 226621d..41ada86 100644 (file)
@@ -4,15 +4,20 @@
 <title>CURLOPT_HTTPPOST man page</title>
 <meta name="generator" content="roffit">
 <STYLE type="text/css">
-P.level0 {
+pre {
+  overflow: auto;
+  margin: 0;
+}
+
+P.level0, pre.level0 {
  padding-left: 2em;
 }
 
-P.level1 {
+P.level1, pre.level1 {
  padding-left: 4em;
 }
 
-P.level2 {
+P.level2, pre.level2 {
  padding-left: 6em;
 }
 
@@ -47,38 +52,41 @@ p.roffit {
 
 <p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
 <p class="level0">CURLOPT_HTTPPOST - specify the multipart formpost content <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
-<p class="level0"><pre>
-<p class="level0">#include &lt;curl/curl.h&gt;
- <p class="level0">CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTPPOST,
- &nbsp;                         struct curl_httppost *formpost);
- </pre>
+<p class="level0"><pre class="level0">
+&#35;include &lt;curl/curl.h&gt;
+&nbsp;
+CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTPPOST,
+&nbsp;                         struct curl_httppost *formpost);
+</pre>
 <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
 <p class="level0">Tells libcurl you want a multipart/formdata HTTP POST to be made and you instruct what data to pass on to the server in the <span Class="emphasis">formpost</span> argument. Pass a pointer to a linked list of curl_httppost structs as parameter.  The easiest way to create such a list, is to use <span Class="emphasis">curl_formadd(3)</span> as documented. The data in this list must remain intact until you close this curl handle again with <span Class="emphasis">curl_easy_cleanup(3)</span>. 
 <p class="level0">Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with <a Class="emphasis" href="./CURLOPT_HTTPHEADER.html">CURLOPT_HTTPHEADER</a>. 
 <p class="level0">When setting <a Class="emphasis" href="./CURLOPT_HTTPPOST.html">CURLOPT_HTTPPOST</a>, it will automatically set <a Class="emphasis" href="./CURLOPT_NOBODY.html">CURLOPT_NOBODY</a> to 0. <a name="DEFAULT"></a><h2 class="nroffsh">DEFAULT</h2>
 <p class="level0">NULL <a name="PROTOCOLS"></a><h2 class="nroffsh">PROTOCOLS</h2>
 <p class="level0">HTTP <a name="EXAMPLE"></a><h2 class="nroffsh">EXAMPLE</h2>
-<p class="level0"><pre>
-<p class="level0">/* Fill in the file upload field. This makes libcurl load data from
- &nbsp;  the given file name when curl_easy_perform() is called. */
- curl_formadd(&formpost,
- &nbsp;            &lastptr,
- &nbsp;            CURLFORM_COPYNAME, "sendfile",
- &nbsp;            CURLFORM_FILE, "postit2.c",
- &nbsp;            CURLFORM_END);
- <p class="level0">/* Fill in the filename field */
- curl_formadd(&formpost,
- &nbsp;            &lastptr,
- &nbsp;            CURLFORM_COPYNAME, "filename",
- &nbsp;            CURLFORM_COPYCONTENTS, "postit2.c",
- &nbsp;            CURLFORM_END);
- <p class="level0">/* Fill in the submit field too, even if this is rarely needed */
- curl_formadd(&formpost,
- &nbsp;            &lastptr,
- &nbsp;            CURLFORM_COPYNAME, "submit",
- &nbsp;            CURLFORM_COPYCONTENTS, "send",
- &nbsp;            CURLFORM_END);
- </pre>
+<p class="level0"><pre class="level0">
+/* Fill in the file upload field. This makes libcurl load data from
+&nbsp;  the given file name when curl_easy_perform() is called. */
+curl_formadd(&formpost,
+&nbsp;            &lastptr,
+&nbsp;            CURLFORM_COPYNAME, "sendfile",
+&nbsp;            CURLFORM_FILE, "postit2.c",
+&nbsp;            CURLFORM_END);
+&nbsp;
+/* Fill in the filename field */
+curl_formadd(&formpost,
+&nbsp;            &lastptr,
+&nbsp;            CURLFORM_COPYNAME, "filename",
+&nbsp;            CURLFORM_COPYCONTENTS, "postit2.c",
+&nbsp;            CURLFORM_END);
+&nbsp;
+/* Fill in the submit field too, even if this is rarely needed */
+curl_formadd(&formpost,
+&nbsp;            &lastptr,
+&nbsp;            CURLFORM_COPYNAME, "submit",
+&nbsp;            CURLFORM_COPYCONTENTS, "send",
+&nbsp;            CURLFORM_END);
+</pre>
 
 <p class="level0"><a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2>
 <p class="level0">As long as HTTP is enabled <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>