问题
I am developing a business central control add in where I need to call external web services. For this, I am using the HttpClient class in AL but no call succeeds.
if not Client.Get('https://google.com', Response)
then begin
responseText := Response.ReasonPhrase();
Message(responseText);
Error('didnt work');
end;
It takes about 2.5-3 Minutes to finish the call. ResponseText is 'OK' and HttpStatusCode is '200' but the call always fails and goes into error handling block.
Reading the response with Response.Content.ReadAs(responseText);
fails with a dynamics error message.
What am I missing? I already granted external access in extension management and tried with sandbox and on premise installs of latest 2019.
回答1:
Go to extension management, select your extension and from Manage menu, select Configure. In the Configure page, set AllowHttpCleintRequest to True.
来源:https://stackoverflow.com/questions/60153873/dynamics-httpclient-call-never-succeeds