Discuss this help topic in SecureBlackbox Forum
Sends the POST request to server.
Declaration
Parameters
Return value
HTTP result code
Description
Use this method to send 'POST' request to server. POST method is used to transfer data to remote resource.
Content parameter (where present) should contain the data to be sent to the server as-is. You can use this parameter to send the pre-formatted form or the stream of data etc.
The variant of the method with Fields and FileField properties lets you submit a form (as you do in browsers) with optional file attachment.
Fields is the list of form field names and values in the form of "Name=Value" in each line. This list can be empty.
FileField contains the name of the field, which stands for attached file (when you look in HTML form source code).
FileName is the name of the file as the server will see it.
FileStream is contents of the submitted file. This is an optional parameter.
ContentType parameter lets you override the default content type.
If FileStream is specified, then ContentType is an attribute of the file (default value is "application/octet-stream").
If FileStream is not specified, then ContentType is an attribute of the form (default value is "application/x-www-form-urlencoded").
The variant of the method with only URL parameter lets you stream the data dynamically via OnHTTPDynamicDataNeeded event. Note that not all servers support such streaming.
To POST/PUT several streams you can use TElMultiStream class: create an instance of this class, add the streams to the TElMultiStream object using AddStream method, and pass the instance of TElMultiStream to Post/Put method.