Einzelnen Beitrag anzeigen

strom

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

AW: XLM Payload als Post

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