AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Hilfe - HTTPS unterschiedliches Verhalten
Thema durchsuchen
Ansicht
Themen-Optionen

Hilfe - HTTPS unterschiedliches Verhalten

Ein Thema von KlausV · begonnen am 2. Aug 2018 · letzter Beitrag vom 3. Aug 2018
 
Delphi.Narium

Registriert seit: 27. Nov 2017
2.555 Beiträge
 
Delphi 7 Professional
 
#13

AW: Hilfe - HTTPS unterschiedliches Verhalten

  Alt 3. Aug 2018, 09:09
ungefähr sowas:
Delphi-Quellcode:
function MyGetUrl(http: tidHTTP; sUrl: string; sl : TStrings; var sMessage: string): Boolean;
begin
  Result := false;
  try
    http.RedirectMaximum := 0; // oder die Anzahl der maximal erwünschten Redirects
    http.HandleRedirects := false; // und hier dann true.
    http.Response.Clear;
    http.Get(sUrl, sl);
    http.Disconnect(True);
    http.IOHandler.InputBuffer.Clear;
    Result := true;
  except
    on e: Exception do begin
      case http.ResponseCode of
        301, 302 : sMessage := http.ResponseText;
      else
        sMessage := AnsiReplaceText(e.Message, #13#10, ' ');
      end;
      // Fehler ggfls. protokollieren:
      PSReg.WriteAppLog(Format('Scriptaufruf : GetSSLMethod(%s)', [sUrl]));
      PSReg.WriteAppLog(Format('Fehlermeldung: %s', [AnsiReplaceText(e.Message, #13#10, ' ')]));
      PSReg.WriteAppLog(Format('SSLMethod : %s', [sMethod]));
      http.Disconnect(True);
      http.IOHandler.InputBuffer.Clear;
    end;
  end;
end;
Minimal:
Delphi-Quellcode:
try
  http.Response.Clear;
  sIrgendeineStringVariabel := http.Get('https://www.delphipraxis.net/dp_recentthreads.php?timeframe=48hr');
  http.Disconnect(True);
  http.IOHandler.InputBuffer.Clear;
except
  on e: Exception do begin
    ShowMessage(e.Exception);
    http.Disconnect(True);
    http.IOHandler.InputBuffer.Clear;
  end;
end;
eventuell auch:
Delphi-Quellcode:
try
  http.Response.Clear;
  try
    sIrgendeineStringVariabel := http.Get('https://www.delphipraxis.net/dp_recentthreads.php?timeframe=48hr');
  except
    ShowMessage(e.Exception);
  end;
finally
  http.Disconnect(True);
  http.IOHandler.InputBuffer.Clear;
end;
  Mit Zitat antworten Zitat
 

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:07 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