1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3<html><head>
4<title>CURLOPT_POST man page</title>
5<meta name="generator" content="roffit">
6<STYLE type="text/css">
7P.level0 {
8 padding-left: 2em;
9}
10
11P.level1 {
12 padding-left: 4em;
13}
14
15P.level2 {
16 padding-left: 6em;
17}
18
19span.emphasis {
20 font-style: italic;
21}
22
23span.bold {
24 font-weight: bold;
25}
26
27span.manpage {
28 font-weight: bold;
29}
30
31h2.nroffsh {
32 background-color: #e0e0e0;
33}
34
35span.nroffip {
36 font-weight: bold;
37 font-size: 120%;
38 font-family: monospace;
39}
40
41p.roffit {
42 text-align: center;
43 font-size: 80%;
44}
45</STYLE>
46</head><body>
47
48<p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
49<p class="level0">CURLOPT_POST - request a HTTP POST <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
50<p class="level0">#include &lt;curl/curl.h&gt; 
51<p class="level0">CURLcode curl_easy_setopt(CURL *handle, CURLOPT_POST, long post); <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
52<p class="level0">A parameter set to 1 tells libcurl to do a regular HTTP post. This will also make the library use a "Content-Type: application/x-www-form-urlencoded" header. (This is by far the most commonly used POST method). 
53<p class="level0">Use one of <a Class="emphasis" href="/CURLOPT_POSTFIELDS.html">CURLOPT_POSTFIELDS</a> or <a Class="emphasis" href="/CURLOPT_COPYPOSTFIELDS.html">CURLOPT_COPYPOSTFIELDS</a> options to specify what data to post and <a Class="emphasis" href="/CURLOPT_POSTFIELDSIZE.html">CURLOPT_POSTFIELDSIZE</a> or <a Class="emphasis" href="/CURLOPT_POSTFIELDSIZE_LARGE.html">CURLOPT_POSTFIELDSIZE_LARGE</a> to set the data size. 
54<p class="level0">Optionally, you can provide data to POST using the <a Class="emphasis" href="/CURLOPT_READFUNCTION.html">CURLOPT_READFUNCTION</a> and <a Class="emphasis" href="/CURLOPT_READDATA.html">CURLOPT_READDATA</a> options but then you must make sure to not set <a Class="emphasis" href="/CURLOPT_POSTFIELDS.html">CURLOPT_POSTFIELDS</a> to anything but NULL. When providing data with a callback, you must transmit it using chunked transfer-encoding or you must set the size of the data with the <a Class="emphasis" href="/CURLOPT_POSTFIELDSIZE.html">CURLOPT_POSTFIELDSIZE</a> or <a Class="emphasis" href="/CURLOPT_POSTFIELDSIZE_LARGE.html">CURLOPT_POSTFIELDSIZE_LARGE</a> options. To enable chunked encoding, you simply pass in the appropriate Transfer-Encoding header, see the post-callback.c example. 
55<p class="level0">You can override the default POST Content-Type: header by setting your own with <a Class="emphasis" href="/CURLOPT_HTTPHEADER.html">CURLOPT_HTTPHEADER</a>. 
56<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> as usual. 
57<p class="level0">If you use POST to a HTTP 1.1 server, you can send data without knowing the size before starting the POST if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with <a Class="emphasis" href="/CURLOPT_HTTPHEADER.html">CURLOPT_HTTPHEADER</a>. With HTTP 1.0 or without chunked transfer, you must specify the size in the request. 
58<p class="level0">When setting <a Class="emphasis" href="/CURLOPT_POST.html">CURLOPT_POST</a> to 1, it will automatically set <a Class="emphasis" href="/CURLOPT_NOBODY.html">CURLOPT_NOBODY</a> to 0. 
59<p class="level0">If you issue a POST request and then want to make a HEAD or GET using the same re-used handle, you must explicitly set the new request type using <a Class="emphasis" href="/CURLOPT_NOBODY.html">CURLOPT_NOBODY</a> or <a Class="emphasis" href="/CURLOPT_HTTPGET.html">CURLOPT_HTTPGET</a> or similar. <a name="DEFAULT"></a><h2 class="nroffsh">DEFAULT</h2>
60<p class="level0">0, disabled <a name="PROTOCOLS"></a><h2 class="nroffsh">PROTOCOLS</h2>
61<p class="level0">HTTP <a name="EXAMPLE"></a><h2 class="nroffsh">EXAMPLE</h2>
62<p class="level0">TODO <a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2>
63<p class="level0">Along with HTTP <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
64<p class="level0">Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
65<p class="level0"><a Class="manpage" href="/CURLOPT_POSTFIELDS.html">CURLOPT_POSTFIELDS</a> <a Class="manpage" href="/CURLOPT_HTTPPOST.html">CURLOPT_HTTPPOST</a> <span Class="manpage"> </span> <p class="roffit">
66 This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
67</body></html>
68