I'm learning AL programming in BC and I'm experimenting with the HttpClient class to make http requests. I try to make a request to the jsonplaceholder api but I get a "The remote name could not be resolved: https://jsonplaceholder.typicode.com/posts". The API is working properly, since I can make a request to it via Postman. I'm working with BC16, in a docker container supposed to represent a SaaS environment. Any ideas why I might get this error? The request code is the following:
local procedure SendHTTPRequest()
var
client: HttpClient;
responseMessage: HttpResponseMessage;
begin
client.Get('https://jsonplaceholder.typicode.com/posts');
Message(Format(responseMessage.HttpStatusCode));
end;
You should make sure that HttpClient requests have been enabled for your extension.
To do that you must do the following:
Extension Management
pageConfigure
Allow HttpClient Requests
is turned on