Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   XLM Payload als Post (https://www.delphipraxis.net/189945-xlm-payload-als-post.html)

strom 10. Aug 2016 12:20

XLM Payload als Post
 
Hallo,

bekomme immer die Fehlermeldung : "HTTP/1.0 301 Moved Permanently" ?

Delphi-Quellcode:
function ExecuteAPI: string;
var
  lHTTP: TIdHTTP;
  lParamList: TStringList;
begin
  lParamList := TStringList.Create;
  lParamList.Add('<?xml version="1.0" encoding="UTF-8">');
  lParamList.Add('<testOperation version="1.0> ');
  lParamList.Add('<uniqueId>blablablabla</uniqueId>');
  lParamList.Add('<basicData>');
  lParamList.Add('<externalNumber>OF120131</externalNumber>');
  lParamList.Add('<keyword>F2/keyword>');
  lParamList.Add('<announcement>Test</announcement>');
  lParamList.Add('<location>Teststrasse 1</location>');
  lParamList.Add('<geo_location>');
  lParamList.Add('</basicData>');
  lParamList.Add('</testOperation>');
  lHTTP := TIdHTTP.Create(nil);
  try
    Result := lHTTP.Post('http://login.test.info/api?authkey=blablablabla=&call=operationData', lParamList);
  finally
    lHTTP.Free;
    lParamList.Free;
  end;
end;
Aufruf

Delphi-Quellcode:
begin
 ExecuteAPI;
end;

mkinzler 10. Aug 2016 12:57

AW: XLM Payload als Post
 
Die Url stimmt?

Die Xml-Struktur ist so auch nicht ganz korrekt

strom 10. Aug 2016 13:24

AW: XLM Payload als Post
 
Hey,
was ist an der Struktur falsch?

URL ,müsste so richtig sein!

-=ZGD=- 10. Aug 2016 13:27

AW: XLM Payload als Post
 
Zitat:

Zitat von mkinzler (Beitrag 1344593)
Die Url stimmt?

Noch!
Diese wurde wohl umgezogen.
Die Information sollte im Response stehen: Location gibt die neue URL an.

himitsu 10. Aug 2016 13:31

AW: XLM Payload als Post
 
Zitat:

Code:
<testOperation version="1.0>

Da fehlt mindestens ein "

Und IdHTTP überträgt das dann auch wirklich als UTF-8?
In der XML steht, dass sie UTF-8 ist,
aber was InHTTP macht, ist eine andere Angelegenheit.

Tipp: ParamList speichern und die Datei an http://www.xmlvalidation.com/?L=2 übergeben.

mjustin 10. Aug 2016 13:49

AW: XLM Payload als Post
 
Es darf keine TStringList verwendet werden. Indy benutzt dann für den Request das Format application/x-www-form-urlencoded.

Stattdessen muss ein Stream verwendet werden, zum Beispiel ein TStringStream.

Ein Beispiel für ein HTTPS POST mit einem JSON Body habe ich hier:

https://mikejustin.wordpress.com/201...-6-https-post/

Delphi-Quellcode:
program JSONPostExample;
 
{$APPTYPE CONSOLE}
 
uses
  IdHTTP, IdGlobal, SysUtils, Classes;
 
var
  HTTP: TIdHTTP;
  RequestBody: TStream;
  ResponseBody: string;
begin
  HTTP := TIdHTTP.Create;
  try
    try
      RequestBody := TStringStream.Create('{"&#26085;&#26412;&#35486;":42}',
        TEncoding.UTF8);
      try
        HTTP.Request.Accept := 'application/json';
        HTTP.Request.ContentType := 'application/json';
        ResponseBody := HTTP.Post('https://httpbin.org/post',
          RequestBody);
        WriteLn(ResponseBody);
        WriteLn(HTTP.ResponseText);
      finally
        RequestBody.Free;
      end;
    except
      on E: EIdHTTPProtocolException do
      begin
        WriteLn(E.Message);
        WriteLn(E.ErrorMessage);
      end;
      on E: Exception do
      begin
        WriteLn(E.Message);
      end;
    end;
  finally
    HTTP.Free;
  end;
  ReadLn;
  ReportMemoryLeaksOnShutdown := True;
end.

strom 10. Aug 2016 16:59

AW: XLM Payload als Post
 
Hallo, bekomme es einfach nicht hin! Fehlercode E/A 105 ??

Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
  HTTP: TIdHTTP;
  RequestBody: TStream;
  ResponseBody: string;
begin
  HTTP := TIdHTTP.Create;
  try
    try
      RequestBody := TStringStream.Create('{123456789}',
        TEncoding.UTF8);
      try
        HTTP.Request.Accept := 'input.xml HTTP/1.0';
        HTTP.Request.ContentType := 'application/x-www-form-urlencoded';
        ResponseBody := HTTP.Post('http://login.fireboard.net/api?authkey={123456789}&call=operation_data',
          RequestBody);
        WriteLn(ResponseBody);
        WriteLn(HTTP.ResponseText);
      finally
        RequestBody.Free;
      end;
    except
      on E: EIdHTTPProtocolException do
      begin
        WriteLn(E.Message);
        WriteLn(E.ErrorMessage);
      end;
      on E: Exception do
      begin
        WriteLn(E.Message);
      end;
    end;
  finally
    HTTP.Free;
  end;
  ReadLn;
  ReportMemoryLeaksOnShutdown := True;
end;

mjustin 10. Aug 2016 18:48

AW: XLM Payload als Post
 
Zitat:

Zitat von strom (Beitrag 1344616)
Hallo, bekomme es einfach nicht hin! Fehlercode E/A 105 ??

Delphi-Quellcode:
...

... in welcher Zeile?

Fritzew 10. Aug 2016 18:53

AW: XLM Payload als Post
 
Hast Du eine Console offen in Deinem Programm?
Wenn nicht kommentiere mal die readln und writeln Zeilen aus.........

-=ZGD=- 10. Aug 2016 20:02

AW: XLM Payload als Post
 
Liste der Anhänge anzeigen (Anzahl: 1)
Das liegt aber daran, dass du den HTTP/301 bekommst. Dieser besagt nach wie vor: Moved permanently...

Anhang 45688

Wie du siehst erfolgt der Request nun über HTTPS.

Warum ist das Bild so klein :(

Zum E/A 105

Code:
WriteLn()
schön und gut. Damit du einen wirklichen Nutzen davon hast: Projektoptionen -> Delphi-Compiler (Linken) -> Konsolenanwendung erzeugen auf
Code:
true
Ich mag die Konsole zum Entwickeln sehr gern, denn das kleine Fenster stört nicht und hilft ausgesprochen gut. Vergiss aber nicht, beim Ausliefern den oben genannten Schalter wieder zu deaktivieren.

Ansonsten möchte WriteLn() natürlich irgendwo hinschreiben. Aber wenn du einen Stift hast und kein Papier, hast du auch nen E/A 105 ;-)

strom 11. Aug 2016 10:34

AW: XLM Payload als Post
 
Hier eine Anleitung zur Schnittstelle, habe es immer noch nicht! :shock:

Der API Aufruf für Einsatzdaten ist an einen Fireboard-Portal-Account gekoppelt. Ein Fireboard-Portal-Account hat für diese API einen Authentifizierungsschlüssel (authkey) der jedem Aufruf mit gegeben werden muss.
Zusätzlich muss der Aufruf durch einen Aufrufschlüssel (call) identifiziert werden.
Folgende API-URL ergibt sich demzufolge:

http://login.fireboard.net/api?authkey={key}&call=operationData

Dem Aufruf wird ein XML Payload als POST mitgegeben.

Die Daten für einen Einsatz enthalten die wichtigsten einsatzrelevanten Angaben:
Einsatzstichwort
Alarmnachricht
Einsatzbeginn
Leitstellennummer
Einsatzort (plus geografische Koordinate im Dezimalgradformat) Lagebeschreibung

Zusätzlich muss jeder Einsatz eine eindeutige Einsatzidentifikationsnummer besitzen um nachträglich eingelieferte Daten diesem Einsatz zuordnen zu können.
Die Einsatzidentifikationsnummer muss für jeden einzelnen Kunden eineindeutig sein (also nach authkey).

Datenstruktur

<?xml version="1.0" encoding="UTF-8"?> <fireboardOperation version="1.0">
<uniqueId>11A1411EAB213194334CED</uniqueId> <basicData>
<externalNumber>OF120137</externalNumber> <keyword>F2</keyword> <announcement>Wohnungsbrand</announcement> <location>Testphasen, Teststrasse 1</location> <geo_location>
<latitude></latitude>
<longitude></longitude>
</geo_location>
<timestampStarted>
<long>1458028846582</long>
</timestampStarted>
<situation>Notruf über Anwohner</situation> </basicData>
</fireboardOperation>

<uniqueId> ist als Pflichtfeld zu verstehen, alle anderen Angaben innerhalb von <basicData> sind optional.
Werden Felder frei gelassen, so befüllt das Fireboard-Portal die entsprechenden Felder mit plausiblen Daten zur späteren Anzeige im Portal.
Wenn <timestampStarted> nicht befüllt wird, so übernimmt Fireboard zur Anzeige das Datum der Einlieferung der Daten.
Eine spätere Korrektur auf <timestampStarted> ist jedoch möglich.

-=ZGD=- 11. Aug 2016 10:42

AW: XLM Payload als Post
 
Was genau ist das Problem?

Das Handbuch ist falsch.
Es ist wie gesagt HTTPS!!!!! noch immer...wie schon oft erwähnt und durch HTTP-Code 301 bestätigt..

strom 11. Aug 2016 15:24

AW: XLM Payload als Post
 
hey,

komme mit dem Fehler Code E/A 105 nicht klar!
Habe es noch nicht verstanden :-(

-=ZGD=- 11. Aug 2016 15:29

AW: XLM Payload als Post
 
Du hast in deinem Quelltext
Delphi-Quellcode:
Writeln('iwas');
stehen.

Entferne diese oder kommentiere sie aus.

Das kommt daher, dass Delphi versucht diese Informationen auf die Konsole zu schreiben, du aber keine hast ;-)
Und wenn nichts da ist, knallt es eben.

strom 12. Aug 2016 08:13

AW: XLM Payload als Post
 
Hallo ZGD,

bekomme jetzt noch als Meldung: Wert für IOHandler ist ungültig?

Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
  HTTP: TIdHTTP;
  RequestBody: TStream;
  ResponseBody: string;
begin
  HTTP := TIdHTTP.Create;
  try
    try
      RequestBody := TStringStream.Create('{123456789}',
        TEncoding.UTF8);
      try
        HTTP.Request.Accept := 'input.xml HTTP/1.0';
        HTTP.Request.ContentType := 'application/x-www-form-urlencoded';
        ResponseBody := HTTP.Post('https://login.fireboard.net/api?authkey={123456789}&call=operation_data',
          RequestBody);
        //WriteLn(ResponseBody);
       // WriteLn(HTTP.ResponseText);
      finally
        RequestBody.Free;
      end;
    except
      on E: EIdHTTPProtocolException do
      begin
        Showmessage(E.Message);
        Showmessage(E.ErrorMessage);
      end;
      on E: Exception do
      begin
        ShowMEssage(E.Message); // Fehlermeldung : Wert für IOHandler ist ungültig !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      end;
    end;
  finally
    HTTP.Free;
    Memo1.Lines.Insert(0, FormatDateTime('hh:nn:ss',Now));
  end;
  //ReadLn;
  //ReportMemoryLeaksOnShutdown := True;
end;

mjustin 12. Aug 2016 08:18

AW: XLM Payload als Post
 
Zitat:

Zitat von strom (Beitrag 1344739)
Hallo ZGD,

bekomme jetzt noch als Meldung: Wert für IOHandler ist ungültig?

Ältere Indy Versionen erfordern, dass ein OpenSSL IOHandler erzeugt und der TIdHTTP Komponenten zugewiesen werden muss.

Die aktuelle Indy Version erzeugt für HTTPS automatisch einen passenden IOHandler.

Lösung: entweder den passenden TIdIOHandlerOpenSSL erzeugen und der IOHandler Property zuweisen, oder Indy aktualisieren.

strom 12. Aug 2016 08:43

AW: XLM Payload als Post
 
Hallo,
würde mich für diese Lösung entscheiden:

Lösung: entweder den passenden TIdIOHandlerOpenSSL erzeugen und der IOHandler Property zuweisen,

Wie würde so eine Zuweisung aussehen?

strom 12. Aug 2016 09:18

AW: XLM Payload als Post
 
Hallo,

meinst Du das so? "HTTP.IOHandler.AllData(nl);"

+nl
+nl

und so weiter.......??

Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
  HTTP: TIdHTTP;
  RequestBody: TStream;
  ResponseBody,nl: string;
begin
  HTTP := TIdHTTP.Create;
  try
    try
      RequestBody := TStringStream.Create('{123456789}',TEncoding.UTF8);
      try
        HTTP.Request.Accept := 'input.xml HTTP/1.0';
        HTTP.Request.ContentType := 'application/x-www-form-urlencoded';
        ResponseBody := HTTP.Post('https://login.fireboard.net/api?authkey={123456789}&call=operation_data',
          RequestBody);
        HTTP.IOHandler.AllData(nl); // in etwa so?
      finally
        RequestBody.Free;
      end;
    except
      on E: EIdHTTPProtocolException do
      begin
        Showmessage(E.Message);
        Showmessage(E.ErrorMessage);
      end;
      on E: Exception do
      begin
       Memo1.Lines.Insert(0,(E.Message)+' '+FormatDateTime('hh:nn:ss',Now));
      end;
    end;
  finally
    HTTP.Free;
    Memo1.Lines.Insert(0,'Zeitstempel '+ FormatDateTime('hh:nn:ss',Now));
  end;
end;

-=ZGD=- 12. Aug 2016 09:30

AW: XLM Payload als Post
 
Lösungen hier in der DP

Oder durch die Suche Hier im Forum suchenindy https

strom 12. Aug 2016 09:53

AW: XLM Payload als Post
 
Habe mir die Beispiele angesehen, mache ich doch!
Versehe ich nicht??

Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
  HTTP: TIdHTTP;
  RequestBody: TStream;
  ResponseBody: string;
begin
  HTTP := TIdHTTP.Create;
  try
    try
      RequestBody := TStringStream.Create('{123456789}',TEncoding.UTF8);
      try
        HTTP.Request.Accept := 'input.xml HTTP/1.0';
        HTTP.Request.ContentType := 'application/x-www-form-urlencoded';
        ResponseBody := HTTP.Post('https://login.fireboard.net/api?authkey={123456789}&call=operation_data',RequestBody); // hier wird der Key doch übermittelt! 
      finally
        RequestBody.Free;
      end;

-=ZGD=- 12. Aug 2016 09:55

AW: XLM Payload als Post
 
Welches Delphi benutzt du?

Wäre es für dich eine Option ggf. auf Indy 10 zu aktualisieren?

Dann hättest du das Problem nicht.

strom 12. Aug 2016 09:59

AW: XLM Payload als Post
 
Habe Delphi XE7 :-)

-=ZGD=- 12. Aug 2016 10:03

AW: XLM Payload als Post
 
Da müsstest du doch Indy 10 haben, oder täusch ich mich?

Mach mal n ButtonClick() und
Delphi-Quellcode:
IdGlobal
in die Uses

Delphi-Quellcode:
var
  HTTP: TIdHTTP;
begin
  HTTP := TIdHTTP.Create;
  ShowMessage('Indy version: ' + http.Version);
  FreeAndNil(HTTP);

strom 12. Aug 2016 10:12

AW: XLM Payload als Post
 
Hey

"idGlobal" ist drin!
"Indoversion: 10.6.1.5182"

-=ZGD=- 12. Aug 2016 10:17

AW: XLM Payload als Post
 
Aktualisere auf Version 10.6.2.XXX.

strom 12. Aug 2016 10:52

AW: XLM Payload als Post
 
Nein :shock:

habe sowas noch nicht gemacht :-( ist bestimmt wieder ein Riesen Ding! oder?

-=ZGD=- 12. Aug 2016 11:12

AW: XLM Payload als Post
 
Nicht sonderlich, aber geht auch anders :-)

Nutze hier Punkt 4) SSL. Damit sollte es funktionieren.

Ich komm gerade nicht zum Testen mit XE7, da ich das Windows 10.1 Update mach ;-)

Edit

Habe es getestet. Gibt Probleme. Gelöst durch das Benutzen dieser DLLs. Lege diese ins gleiche Verzeichnis wie deine EXE. Also schätzungsweise nach
Code:
Win32/Debug
Grüße,
Stefan

mjustin 12. Aug 2016 11:48

AW: XLM Payload als Post
 
Zitat:

Zitat von strom (Beitrag 1344759)
Nein :shock:

habe sowas noch nicht gemacht :-( ist bestimmt wieder ein Riesen Ding! oder?

Nicht so schlimm wie es sich anhört. Man muss die Indy Komponenten nicht unbedingt in der IDE installieren, wenn man sie nur dynamisch (zur Laufzeit) erzeugt.

- Indy herunterladen oder aus dem Subversion Repository auschecken
- Die Verzeichnisse Lib\Code, Lib\Protocols und Lib\System dem Projekt-Suchpfad hinzufügen (damit ist sichergestellt, dass nur diese eine Projekt die neue Version verwendet)
- kompilieren

strom 12. Aug 2016 13:13

AW: XLM Payload als Post
 
Erstmal vielen Dank für die Hilfe!

aber der Hund liegt woanders begraben, immer noch die gleiche Meldung ;-(

mjustin 12. Aug 2016 13:18

AW: XLM Payload als Post
 
Zitat:

Zitat von strom (Beitrag 1344781)
Erstmal vielen Dank für die Hilfe!

aber der Hund liegt woanders begraben, immer noch die gleiche Meldung ;-(

Funktioniert der Code aus meinem Beispiel in Beitrag #6 denn?

-=ZGD=- 12. Aug 2016 13:45

AW: XLM Payload als Post
 
Kann dein "geht immer noch nicht" nicht nachvollziehen.

Delphi XE7

Delphi-Quellcode:
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.
Einfach
Delphi-Quellcode:
Button & Memo
auf das Formular und OnClick() beim Button das rein.
Wenn du alles "richtig" gemacht hast, erhältst du als Antwort:

Code:
{"status":"error","errors":["unauthorized"]}
Wichtig

Hast du die beiden DLLs wie weiter oben beschrieben ins Verzeichnis zur Projekt-EXE gelegt?

strom 12. Aug 2016 17:58

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

-=ZGD=- 12. Aug 2016 18:02

AW: XLM Payload als Post
 
Zitat:

Zitat von strom (Beitrag 1344825)
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

Woher hast du denn den Schlüssel? :D

strom 12. Aug 2016 18:15

AW: XLM Payload als Post
 
hallo mjustin,

funktioniert leider auch nicht :-( :(

strom 12. Aug 2016 18:19

AW: XLM Payload als Post
 
hallo ZGD,

Code:
{"status":"error","errors":["unauthorized"]}
diese Meldung bekomme ich auch mit dem vorgegebenen Schlüssel!
Mir wurde bestimmt der falsche Schlüssel mitgeteilt!

-=ZGD=- 12. Aug 2016 20:55

AW: XLM Payload als Post
 
Immerhin bist du der Lösung nahe :)

strom 15. Aug 2016 13:29

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;

-=ZGD=- 16. Aug 2016 09:09

AW: XLM Payload als Post
 
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;
Tag
Delphi-Quellcode:
geo_location
wurde geöffnet, aber nicht geschlossen.

Mavarik 16. Aug 2016 09:57

AW: XLM Payload als Post
 
Zitat:

Zitat von -=ZGD=- (Beitrag 1344952)
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>'); // < fehlt
  params.Add('<announcement>Wohnungsbrand</announcement>');
  params.Add('<location>Test, Teststraße 1</location>');
  params.Add('<geo_location>');// Endtag?
  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;
Tag
Delphi-Quellcode:
geo_location
wurde geöffnet, aber nicht geschlossen.

Noch 2 Fehler?

mjustin 16. Aug 2016 12:27

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 04:24 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz