Here is my code which works well with 'https://www.tmssoftware.com/site/blog.asp'
but not any other URL. Why?????
type
TfWebTest = class(TWebForm)
WebMemo1: TWebMemo;
btnDownload: TWebButton;
Req: TWebHttpRequest;
procedure btnDownloadClick(Sender: TObject);
private
[async]
procedure DoDownload;
end;
var
fWebTest: TfWebTest;
implementation
{$R *.dfm}
procedure TfWebTest.DoDownload;
var
LRes : TJSXMLHttpRequest;
begin
{
object Req: TWebHttpRequest
Headers.Strings = (
'Cache-Control=no-cache, no-store, must-revalidate')
Command = httpGET
ResponseType = rtText
Left = 216
Top = 24
end
}
btnDownload.Caption := 'Loading';
// Req.URL := 'https://www.tmssoftware.com/site/blog.asp'; // works fine!!!
// Req.URL := 'http://www.ckcmed.com/test/links.txt'; // does not work ???
Req.URL := 'https://ckcdata.com/test/test.html'; // does not work ???
LRes := await(TJSXMLHttpRequest, Req.Perform);
WebMemo1.Lines.Add(LRes.responseText);
btnDownload.Caption := 'Done';
end ;
procedure TfWebTest.btnDownloadClick(Sender: TObject);
begin
DoDownload;
end;
end.