Was mache ich hier falsch? User und Passwort stimmen!
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
params: TStringList;
request, content, response: string;
begin
IdHTTP1.request.Charset := 'utf-8';
IdHTTP1.request.BasicAuthentication := true;
IdHTTP1.request.Username := 'User';
IdHTTP1.request.Password := 'Passwort';
IdHTTP1.request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP1.request.Host := '192.168.0.251:9876';
params := TStringList.Create;
try
params.Add('type=fms');
params.Add('address='+Edit1.Text);
params.Add('status='+Edit2.Text);
params.Add('message='+Memo1.Text);
params.Add('info='+Edit3.Text);
response := IdHTTP1.Post('http://192.168.0.251:9876/telegramin/alarmgeber/input.xml', params); // Hier ist der POST-Request
finally
params.Free;
end;
end;