That was my idea as well to ping some public domain, but I was wondering if there is a better sollution, like a system codeunit with this kind of functionality.
Won't it work incorrectly if http request is blocked for our extension?
Yes it will, but you could add a few lines of code to check that with the HTTPResponseMesage.IsBlockedByEnvironment()
trigger OnRun()
var
Client : HttpClient;
Response : HttpResponseMessage;
begin
if Response.IsBlockedByEnvironment() then
Error('Please give access on extension management');
end;
For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
Answers
if you get a 200 OK then you are able to connect to other sites.
Won't it work incorrectly if http request is blocked for our extension?