Vielleicht so in diese Richtung!
Wer hat noch eine bessere Idee?
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
request, nl, content :
string;
i : integer;
begin
content := '
address=1234567&message=hallo';
if IdTCPClient1.Connected
then IdTCPClient1.Disconnect;
IdTCPClient1.Connect;
nl := AnsiChar(#13) + AnsiChar(#10);
request := '
POST /telegramin/alarmgeber/index.xml HTTP/1.1' + nl
+ '
Content-Type: application/x-www-form-urlencoded' + nl
+ '
Host: localhost' + nl
+ '
Content-Length: ' + IntToStr(length(content)) + nl
+ '
Expect: 100-continue' + nl
+ '
Connection: Keep-Alive'+ nl + nl
+ content;
IdTCPClient1.IOHandler.WriteLn(request);
for I := 1
to 20
do
Memo1.Lines.Add(IdTCPClient1.IOHandler.ReadLn);
IdTCPClient1.Disconnect;
end;