Skip to content

libcURL.cURLClient.Post

Andrew Lambert edited this page Jun 14, 2017 · 31 revisions

Method Signatures

 Function Post(URL As String, FormData As Dictionary, WriteTo As Writeable = Nil) As Boolean
 Function Post(URL As String, PostFields() As String, WriteTo As Writeable = Nil) As Boolean
 Function Post(URL As String, FormData As libcurl.MultipartForm, WriteTo As Writeable = Nil) As Boolean
 Sub Post(URL As String, FormData As Dictionary, WriteTo As Writeable = Nil)
 Sub Post(URL As String, PostFields() As String, WriteTo As Writeable = Nil)
 Sub Post(URL As String, FormData As libcurl.MultipartForm, WriteTo As Writeable = Nil)

Parameters

Post(String, Dictionary, Writeable)

Name Type Comment
URL String The RFC 3986 URI to which the form should be posted.
FormData Dictionary An HTML form which will be encoded as multipart/form-data.
WriteTo Writeable Optional. Downloaded data (if any) will be written to this object. If this parameter is Nil then use GetDownloadedData.

Post(String, String(), Writeable)

Name Type Comment
URL String The RFC 3986 URI to which the form should be posted.
PostFields String array An HTML form which will be encoded as application/x-www-form-urlencoded.
WriteTo Writeable Optional. Downloaded data (if any) will be written to this object. If this parameter is Nil then use GetDownloadedData.

Post(String, MultipartForm, Writeable)

Name Type Comment
URL String The RFC 3986 URI to which the form should be posted.
FormData MultipartForm An HTML form which will be encoded as multipart/form-data.
WriteTo Writeable Optional. Downloaded data (if any) will be written to this object. If this parameter is Nil then use GetDownloadedData.

Return value

The synchronous versions of this method return True on success.

Remarks

POST the passed HTML form via HTTP(S), using either multipart/form-data or application/x-www-form-urlencoded.

To encode the form using multipart/form-data, pass a Dictionary of NAME:VALUE pairs comprising HTML form elements: NAME is a string containing the form-element name; VALUE may be a string or a FolderItem. You may also specify a MultipartForm instance for advanced options.

To encode the form using application/x-www-form-urlencoded, pass an array of URL-encoded NAME=VALUE strings comprising HTML form elements.

If the URL parameter is empty ("") then the URL option is not modified (i.e. the previous URL is reused; if there is no previous URL then the transfer will fail with error code CURLE_URL_MALFORMAT(3).)

Expect: 100-Continue

When using HTTP/1.1, libcURL will send a Expect: 100-Continue header and then wait briefly for the server to respond. This allows HTTP/1.1 servers to reject the operation before the (potentially large) form payload is transferred. Not all servers support this feature, and libcURL will continue normally if no intermediate reply comes from the server. You may disable this feature by deleting the Expect header.

See also

Clone this wiki locally