I found the solution. It is mandatory to specify the MimeType.

Also, I replaced the TStringList by WriteStrToStream function, from SynaUtil.

    WriteStrToStream(lHttp.Document, EncodeURL(AParams));
    lHttp.MimeType := 'application/x-www-form-urlencoded';
 
Leonardo M. Ramé
http://leonardorame.blogspot.com


>________________________________
>From: Leonardo M. Ramé <martinr...@yahoo.com>
>To: 'Ararat Synapse' <synalist-public@lists.sourceforge.net>
>Sent: Monday, August 29, 2011 11:31 AM
>Subject: [Synalist] THTTPSend POST params
>
>
>Hi, I'm trying to send data as POST using THTTPSend, but the server is not 
>getting the post params.
>
>
>I'm using THttpSend because I need to set HeartBeat. Before this, I used 
>HttpPostUrl and it worked as expected.
>
>
>What I'm doing wrong here?:
>
>
>    lHttp := THttpSend.Create;
>    
>    // prepare POST parameters
>    lPostData :=TStringList.Create;
>    lPostData.Add(EncodeURL('IdTurno=1234'));
>    lPostData.SaveToStream(lHttp.Document);
>
>
>
>    // send the request to server
>    if lHttp.HTTPMethod('POST', '/server/url') then
>    begin
>      // process result
>    end;   
>
> 
>Leonardo M. Ramé
>http://leonardorame.blogspot.com
>------------------------------------------------------------------------------
>EMC VNX: the world's simplest storage, starting under $10K
>The only unified storage solution that offers unified management 
>Up to 160% more powerful than alternatives and 25% more efficient. 
>Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
>_______________________________________________
>synalist-public mailing list
>synalist-public@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/synalist-public
>
>
>
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to