AW: Hilfe - HTTPS unterschiedliches Verhalten
Zitat:
|
AW: Hilfe - HTTPS unterschiedliches Verhalten
Delphi 7
Menü "Suchen" Untermenü: "Laufzeitfehler suchen". Ins erscheinende Eingabefeld die Adresse rein und Enter. Es sollte dann die passende Stelle im Quelltext gesucht werden. |
AW: Hilfe - HTTPS unterschiedliches Verhalten
Zitat:
Den IOhandler für SSL muss man wohl nicht mehr erzeugen. Habe den auskommentiert. Indy erkennt es anhand der URL. Jetzt mache ich erst mal schluss und teste morgen noch weiter. |
AW: Hilfe - HTTPS unterschiedliches Verhalten
Zitat:
|
AW: Hilfe - HTTPS unterschiedliches Verhalten
ungefähr sowas:
Delphi-Quellcode:
Minimal:
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;
Delphi-Quellcode:
eventuell auch:
try
http.Response.Clear; sIrgendeineStringVariabel := http.Get('https://www.delphipraxis.net/dp_recentthreads.php?timeframe=48hr#039;); 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;
Delphi-Quellcode:
try
http.Response.Clear; try sIrgendeineStringVariabel := http.Get('https://www.delphipraxis.net/dp_recentthreads.php?timeframe=48hr#039;); except ShowMessage(e.Exception); end; finally http.Disconnect(True); http.IOHandler.InputBuffer.Clear; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:48 Uhr. |
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