Discuss this help topic in SecureBlackbox Forum

TElHTTPSClient.Post

TElHTTPSClient     See also     


Filter: C#  VB.NET  Pascal  C++  PHP  Java  


Sends the POST request to server.

Declaration

[C#]
    int Post(string URL);
    int Post(string URL, string Content);
    int Post(string URL, byte[] Content);
    int Post(string URL, System.IO.Stream Content, bool CloseStream);

[VB.NET]
    Function Post(ByVal URL As String) As Integer
    Function Post(ByVal URL As String, ByVal Content As String) As Integer
    Function Post(ByVal URL As String, ByVal Content As Byte()) As Integer
    Function Post(ByVal URL As String, ByVal Content As System.IO.Stream, ByVal CloseStream As Boolean) As Integer

[Pascal]
    function Post(const URL : string) : integer; overload;
    function Post(const URL : string; const Content : string) : integer; overload;
    function Post(const URL : string; const Content : ByteArray) : integer; overload;
    function Post(const URL : string; Content : TStream; CloseStream : Boolean = false) : integer; overload;

[C++]
    int32_t Post(const std::string &URL);
    int32_t Post(const std::string &URL, const std::string &Content);
    int32_t Post(const std::string &URL, const std::vector<uint8_t> &Content);
    int32_t Post(const std::string &URL, TStream &Content, bool CloseStream);
    int32_t Post(const std::string &URL, TStream *Content, bool CloseStream);

[PHP]
    integer Post(string $URL)
    integer Post(string $URL, string $Content)
    integer Post(string $URL, array of byte|string|NULL $Content)
    integer Post(string $URL, TStream $Content, bool $CloseStream)

[Java]
    int post(String URL, byte[] Content);
    int post(String URL, TElStream Content, boolean CloseStream);
    int post(String URL, String Content);
    int post(String URL);

Parameters

  • URL - specifies resource address. This method does NOT encode the parameters that you pass in the URL, they need to be encoded prior to calling the method.
  • Content - request body
  • FileStream (Stream) - stream with file data. Default value is null.
  • CloseStream - specifies if FileStream object should be freed after request execution. Default value is False.

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 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.

    To post the web form data (including file attachments to the form) use PostWebForm method.

See also:     Delete     PostWebForm     Put     Get     Options     Trace     Head     OnDynamicDataNeeded     TElMultiStream    

Discuss this help topic in SecureBlackbox Forum