Hi, Im trying to post information to a web server through a Delphi app. I'm using the Indy components, to a very simple php page :
echo '$algo1<br>';echo '$algo2<br>'
And i have this Delphi code:
aStream := TMemoryStream.create;
Params := TStringStream.create('');
HTTP.Request.ContentType := 'application/x- Params.WriteString(('algo1=something'));
Params.WriteString(('algo2=otherstuff'));
try
with HTTP do begin
try
HTTP.Post(' Params, aStream);
except
on E: Exception do
showmessage('Error encountered during POST: ' + E.Message);
end;
end;
aStream.WriteBuffer(#0' ', 1);
showmessage(PChar(aStream.Memory));
except
end;
I only receive a "<br><br>" as a response from the php. I tried also with Params.WriteString(('algo1=something&algo2=otherstuff'));
and doesn't work.
Am I doing something wrong?
Ah, and other stuff: I want to post a big amount of data to a web server and the app sendme the error "Connection closed gracefully" what does it mean? (I don't find it graceful)
Thanks in advice
Ivo
echo '$algo1<br>';echo '$algo2<br>'
And i have this Delphi code:
aStream := TMemoryStream.create;
Params := TStringStream.create('');
HTTP.Request.ContentType := 'application/x- Params.WriteString(('algo1=something'));
Params.WriteString(('algo2=otherstuff'));
try
with HTTP do begin
try
HTTP.Post(' Params, aStream);
except
on E: Exception do
showmessage('Error encountered during POST: ' + E.Message);
end;
end;
aStream.WriteBuffer(#0' ', 1);
showmessage(PChar(aStream.Memory));
except
end;
I only receive a "<br><br>" as a response from the php. I tried also with Params.WriteString(('algo1=something&algo2=otherstuff'));
and doesn't work.
Am I doing something wrong?
Ah, and other stuff: I want to post a big amount of data to a web server and the app sendme the error "Connection closed gracefully" what does it mean? (I don't find it graceful)
Thanks in advice
Ivo