Einzelnen Beitrag anzeigen

strom

Registriert seit: 23. Aug 2008
Ort: Keine Ergebnisse gefunden
290 Beiträge
 
#15

AW: XLM Payload als Post

  Alt 12. Aug 2016, 08:13
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;
  Mit Zitat antworten Zitat