I'm using IdHTTP for a simple Get request:
procedure TForm1.FormCreate(Sender: TObject);
const
URL = 'https://www.udemy.com/course/the-modern-angular-bootcamp/';
begin
IdSSLIOHandler.SSLOptions.Method := sslvSSLv23;
IdHttp1.Request.UserAgent :=
'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0';
Memo1.Lines.Text := IdHTTP1.Get(URL);
The call to IdHTTP1.Get results in the error "HTTP/1.1 403 Forbidden".
A similar question (Why do I get "403 Forbidden" when I connect to whatismyip.com?) says the UserAgent should be set to a modern value. I have done so, but it does not help.
I'm using OpenSSL Win32 v1.0.2u. Tokyo, Windows 10
Similar code using THttpClient works without any problem:
HttpClient := THTTPClient.Create;
try
Response := HttpClient.Get(URL);
Memo1.Lines.Text := Response.ContentAsString();
finally
HttpClient.Free;
end;