Delphi 2010 - Post tidhttp
-
12-11-2019 - |
Domanda
Voglio pubblicare dati sul seguente URL:
http://mehratin.heroku.com/personals/new
Scrivo il seguente codice ma ha problemi:
procedure TForm1.Button3Click(Sender: TObject);
var
aStream: TMemoryStream;
Params: TStringList;
begin
aStream := TMemoryStream.Create;
Params := TStringList.Create;
try
with IdHTTP1 do
begin
Params.Add('fname=123');
Params.Add('lname=123');
Request.ContentType := 'application/x-www-form-urlencoded';
try
Response.KeepAlive := False;
Post('http://localhost:3000/personals/new', Params);
except
on E: Exception do
showmessage('Error encountered during POST: ' + E.Message);
end;
end;
Come posso pubblicare dati tramite il metodo tidhttttp.post in Delphi 2010?
Nessuna soluzione corretta
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow