Hi,
I have installed Apache2 server on my computer (OS: Ubuntu 10.04), with PHP and MySqlite support.
I am using this function below to send HTTP post method to a PHP file (that resides in a site also in my computer), I am using synapse library.
function PostInetCommand(cPostData:string):string;
var
HTTP: THTTPSend;
l: tstringlist;
cResponse:string;
b:boolean;
begin
HTTP := THTTPSend.Create;
l := TStringList.Create;
try
if not HTTP.HTTPMethod('POST',cPostData) then
begin
Result:= 'Error';
end
else
begin
l.loadfromstream(Http.Document);
Result:= l.Text;
end;
finally
HTTP.Free;
l.free;
end;
end;
I find that the program operation freezes momentarily and the response from PHP file is very slow (at least 3 -4 seconds), whereas the same post operation done from a browser is instantaneous.
Please explain why this is happening ?? also how can I improve the performance.
PS: Sorry if I could not make myself clear as I am new to network programming.
thanks
nm