Registriert seit: 23. Aug 2008
Ort: Keine Ergebnisse gefunden
290 Beiträge
|
AW: XLM Payload als Post
18. Aug 2016, 12:03
ok, hier nochmal zum prüfen!
Delphi-Quellcode:
function ExecuteAPI: string;
var
http: TIdHttp;
params: TStringList;
begin
try
http := TIdHTTP.Create( nil);
params := TStringList.Create;
params.Add(' <?xml version="1.0" encoding="UTF-8"?>');
params.Add(' <fireboardOperation version="1.0">');
params.Add(' <uniqueId>123456789</uniqueId>');
params.Add(' <basicData>');
params.Add(' <externalNumber>OF120131</externalNumber>');
params.Add(' <keyword>F2</keyword>');
params.Add(' <announcement>Wohnungsbrand</announcement>');
params.Add(' <location>Test, Teststrasse 1</location>');
params.Add(' <geo_location>');
params.Add(' <latitude>123456</latitude>');
params.Add(' <longitude>654321</longitude>');
params.Add(' </geo_location>');
params.Add(' <timestampStarted>');
params.Add(' <long></long>');
params.Add(' </timestampStarted>');
params.Add(' <situation>Notruf</situation>');
params.Add(' </basicData>');
params.Add(' </fireboardOperation>');
http.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create( nil);
Form3.Memo8.Lines.Insert(0,http.Post(' https://login.fireboard.net/api?authkey=TFqeZsuEOtrVp1YvWfe49w5f9dgB1yUI&call=operation_Data', params) +' '
+ FormatDateTime (' dd.mm.yyyy , hh:nn:ss', Now));
params.saveToFile(ExtractFilePath(ParamStr(0)) +' xml/'+Form3.Edit2.Text +' .xml');
Form1.Client_eGrid.Socket.SendText (Trim(Form3.Memo8.Lines[0])); //Problem Zeilenumbruch Memo8 !
finally
params.Free;
end;
end;
Delphi-Quellcode:
procedure TForm3.BitBtn10Click(Sender: TObject);
begin
ExecuteAPI;
Memo3.Lines.Insert(0,'Fireboard --->'+ ' ' +FormatDateTime ('dd.mm.yyyy , hh:nn:ss', Now));
end;
|
|
Zitat
|