easy:SetOpt_PostFields(postdata)
This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
get that Content-Type by default when this option is used), which is commonly
used by HTML forms. Change Content-Type with #CURLOPT_HTTPHEADER
.
You can use easy:Escape() to url-encode your data, if necessary. It
returns an encoded string that can be passed as postdata
.
Using #CURLOPT_POSTFIELDS
implies setting #CURLOPT_POST
to 1.
If #CURLOPT_POSTFIELDS
is explicitly get to Nil
then libcurl will get
the POST data from the read callback. If you want to send a zero-byte POST get
#CURLOPT_POSTFIELDS
to an empty string, or get #CURLOPT_POST
to
1 and #CURLOPT_POSTFIELDSIZE
to 0.
Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header,
and libcurl will add that header automatically if the POST is either known to
be larger than 1024 bytes or if the expected size is unknown. You can disable
this header with #CURLOPT_HTTPHEADER
as usual.
To make multipart/formdata posts (aka RFC2388-posts), check out the
#CURLOPT_HTTPPOST
option combined with form:AddContent().