TWebHttpRequest not working with my URLs - Can't figure out why. Please help!

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.

You need to enable CORS on the website. https://ckcdata.com if not accessing it from same host.

Thanks for the help!
How do I enable CORS? Currently, I am not using a dedicated server.
Contact my web host?

Hi
The example urls you use are static files (links.txt and test.html) so I think you need to enable CORS via Apache configuration files. If you are able to upload some php scripts on your server add header('Access-Control-Allow-Origin: *'); to top of the php code.

Or just upload your TMSweb folder on that domain then it will work, since hosted on the same server.

I am going to do that! Didn't think about it, initially!
Thanks for the advice :blush: