![]() |
AW: XLM Payload als Post
Kann dein "geht immer noch nicht" nicht nachvollziehen.
Delphi XE7
Delphi-Quellcode:
Einfach
unit Unit2;
interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, IdHttp, IdSSLOpenSSL, Vcl.StdCtrls; type TForm2 = class(TForm) Button1: TButton; Memo1: TMemo; procedure Button1Click(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end; var Form2: TForm2; implementation {$R *.dfm} procedure TForm2.Button1Click(Sender: TObject); var http: TIdHttp; params: TStringList; begin try http := TIdHTTP.Create(nil); params := TStringList.Create; http.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); memo1.Text := http.Post('https://login.fireboard.net/api?authkey=blablablabla=&call=operationData', params); finally end; end; end.
Delphi-Quellcode:
auf das Formular und OnClick() beim Button das rein.
Button & Memo
Wenn du alles "richtig" gemacht hast, erhältst du als Antwort:
Code:
Wichtig
{"status":"error","errors":["unauthorized"]}
Hast du die beiden DLLs wie weiter oben beschrieben ins Verzeichnis zur Projekt-EXE gelegt? |
AW: XLM Payload als Post
Hallo Ihr lieben,
schönen Dank für Eure Hilfe, werde den Fehler bestimmt noch finden! Muss jetzt erstmal alles verstehen :) und testen! Vielleicht ist auch der Schüssel falsch? Mal schauen... Danke Danke Danke |
AW: XLM Payload als Post
Zitat:
|
AW: XLM Payload als Post
hallo mjustin,
funktioniert leider auch nicht :-( :( |
AW: XLM Payload als Post
hallo ZGD,
Code:
diese Meldung bekomme ich auch mit dem vorgegebenen Schlüssel!
{"status":"error","errors":["unauthorized"]}
Mir wurde bestimmt der falsche Schlüssel mitgeteilt! |
AW: XLM Payload als Post
Immerhin bist du der Lösung nahe :)
|
AW: XLM Payload als Post
Hallo,
also der Schlüssel ist korrekt! Ist die XML Formatierung in der StringList so richtig? Liegt vielleicht hier der Fehler?
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>11202020</uniqueId>'); params.Add('<basicData>'); params.Add('<externalNumber>OF120131</externalNumber>'); params.Add('<keyword>F2/keyword>'); params.Add('<announcement>Wohnungsbrand</announcement>'); params.Add('<location>Test, Teststraße 1</location>'); params.Add('<geo_location>'); params.Add('</basicData>'); params.Add('</fireboardOperation>'); http.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); Form3.Memo8.Lines.Insert(0,http.Post('https://login.fireboard.net/api?authkey=123456789=&call=operation_Data', params)+' ' + FormatDateTime ('dd.mm.yyyy , hh:nn:ss', Now)); finally params.Free; end; end; |
AW: XLM Payload als Post
Delphi-Quellcode:
Tag
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>11202020</uniqueId>'); params.Add('<basicData>'); params.Add('<externalNumber>OF120131</externalNumber>'); params.Add('<keyword>F2/keyword>'); params.Add('<announcement>Wohnungsbrand</announcement>'); params.Add('<location>Test, Teststraße 1</location>'); params.Add('<geo_location>'); params.Add('</basicData>'); params.Add('</fireboardOperation>'); http.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); Form3.Memo8.Lines.Insert(0,http.Post('https://login.fireboard.net/api?authkey=123456789=&call=operation_Data', params)+' ' + FormatDateTime ('dd.mm.yyyy , hh:nn:ss', Now)); finally params.Free; end; end;
Delphi-Quellcode:
wurde geöffnet, aber nicht geschlossen.
geo_location
|
AW: XLM Payload als Post
Zitat:
|
AW: XLM Payload als Post
Dass TStringList nicht für die Parameter verwendet werden darf hatte ich in Beitrag #6 ja bereits erwähnt. Auch fehlt das Encoding - es ist nur im XML, aber nicht im Request angegeben, dieser verwendet daher das Plattform-Encoding (ANSI).
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:31 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz