Revert "Update to 7.40.1"
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_POSTFIELDS.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH CURLOPT_POSTFIELDS 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_POSTFIELDS \- specify data to POST to server
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_POSTFIELDS, char *postdata);
30 .SH DESCRIPTION
31 Pass a char * as parameter, pointing to the full data to send in a HTTP POST
32 operation. You must make sure that the data is formatted the way you want the
33 server to receive it. libcurl will not convert or encode it for you in any
34 way. For example, the web server may assume that this data is url-encoded.
35
36 The data pointed to is NOT copied by the library: as a consequence, it must be
37 preserved by the calling application until the associated transfer finishes.
38
39 This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
40 set that Content-Type by default when this option is used), which is commonly
41 used by HTML forms. Change Content-Type with \fICURLOPT_HTTPHEADER(3)\fP.
42
43 Using \fICURLOPT_POSTFIELDS(3)\fP implies \fICURLOPT_POST(3)\fP.
44
45 If you want to do a zero-byte POST, you need to set
46 \fICURLOPT_POSTFIELDSIZE(3)\fP explicitly to zero, as simply setting
47 \fICURLOPT_POSTFIELDS(3)\fP to NULL or "" just effectively disables the
48 sending of the specified string. libcurl will instead assume that you'll send
49 the POST data using the read callback!
50
51 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
52 You can disable this header with \fICURLOPT_HTTPHEADER(3)\fP as usual.
53
54 To make multipart/formdata posts (aka RFC2388-posts), check out the
55 \fICURLOPT_HTTPPOST(3)\fP option combined with \fIcurl_formadd(3)\fP.
56 .SH DEFAULT
57 NULL
58 .SH PROTOCOLS
59 HTTP
60 .SH EXAMPLE
61 TODO
62 .SH AVAILABILITY
63 Always
64 .SH RETURN VALUE
65 Returns CURLE_OK
66 .SH "SEE ALSO"
67 .BR CURLOPT_POSTFIELDSIZE "(3), " CURLOPT_READFUNCTION "(3), "