EldoS | Feel safer!

Software components for data protection, secure storage and transfer

ElHTTPSClient.Post with params

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#7822
Posted: 10/08/2008 08:55:13
by Luc Pelletier (Standard support level)
Joined: 10/08/2008
Posts: 1

Hi,
I need to post on a web server with parameters. When I use the post function and set the params Fields, the post never send parameters value to web server but the result I receive always is 200, but if I add the params on URL, post work perfectly. I give you an example.

I have local WebServer with PHP page. On my page, if the parameter "aaa" is set, the page return "aaa" value. But if "aaa" doesn't set, the page return "Don't set".

If I use this code (Delphi), I always receive "aaa" value :
Code
procedure CallPHP;
begin
  Https.Post('http://192.168.2.106/testpage.php?aaa=123', '');
end;

procedure HttpsData(Sender: TObject; Buffer: Pointer; Size: Integer);
var
  lString : string;
begin
  SetLength(lString, Size);
  Move(Buffer^, lString[1], Size);
  ShowMessage(lString);  //HERE THE RESULT IS "123"
  Application.ProcessMessages;
end;


If I use this code, I always receive "Don't set" :
Code
procedure CallPHP;
var
  lTest : TStringList;
begin
  lTest := TStringList.Create;
  lTest.Add('aaa=123');
  Https.Post('http://192.168.2.106/testpage.php', lTest);
  lTest.Free;
end;

procedure HttpsData(Sender: TObject; Buffer: Pointer; Size: Integer);
var
  lString : string;
begin
  SetLength(lString, Size);
  Move(Buffer^, lString[1], Size);
  ShowMessage(lString);  //HERE THE RESULT IS "DON'T SET"
  Application.ProcessMessages;
end;


Do you have a solution because I would like to use the function with Fields parameters.

Thanks
#7823
Posted: 10/08/2008 09:31:32
by Eugene Mayevski (EldoS Corp.)

Moved to helpdesk


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 1408 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!