updated the CURLOPT_POST description after input from Alan Pinstein

This commit is contained in:
Daniel Stenberg
2004-08-10 13:22:08 +00:00
parent d5bdf5f89c
commit 355b3d3057

View File

@@ -469,16 +469,27 @@ data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
This option is deprecated and starting with version 7.12.1 you should instead This option is deprecated and starting with version 7.12.1 you should instead
use \fICURLOPT_UPLOAD\fP. use \fICURLOPT_UPLOAD\fP.
.IP CURLOPT_POST .IP CURLOPT_POST
A non-zero parameter tells the library to do a regular HTTP post. This is a A non-zero parameter tells the library to do a regular HTTP post. This will
normal application/x-www-form-urlencoded kind, which is the most commonly used also make the library use the a "Content-Type:
one by HTML forms. See the \fICURLOPT_POSTFIELDS\fP option for how to specify application/x-www-form-urlencoded" header. (This is by far the most commonly
the data to post and \fICURLOPT_POSTFIELDSIZE\fP in how to set the data used POST method).
size. Using the \fICURLOPT_POSTFIELDS\fP option implies this option.
Use the \fICURLOPT_POSTFIELDS\fP option to specify what data to post and
\fICURLOPT_POSTFIELDSIZE\fP to set the data size. Optionally, you can provide
data to POST using the \fICURLOPT_READFUNCTION\FP and \fICURLOPT_READDATA\fP
options.
You can override the default POST Content-Type: header by setting your own
with \fICURLOPT_HTTPHEADER\fP.
NOTE: if you have issued a POST request and want to make a HEAD or GET
instead, you must explictly pick the new request type using
\fICURLOPT_NOBODY\fP or \fICURLOPT_HTTPGET\fP or similar.
.IP CURLOPT_POSTFIELDS .IP CURLOPT_POSTFIELDS
Pass a char * as parameter, which should be the full data to post in an HTTP Pass a char * as parameter, which should be the full data to post in an HTTP
post operation. You need to make sure that the data is formatted the way you POST operation. You must make sure that the data is formatted the way you want
want the server to receive it. libcurl will not convert or encode it for the server to receive it. libcurl will not convert or encode it for you. Most
you. Most web servers will assume this data to be url-encoded. Take note. web servers will assume this data to be url-encoded. Take note.
This POST is a normal application/x-www-form-urlencoded kind (and libcurl will This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
set that Content-Type by default when this option is used), which is the most set that Content-Type by default when this option is used), which is the most