我正在学习BC中的AL编程,并且正在尝试使用HttpClient类发出http请求。我尝试向jsonplaceholder api发出请求,但得到一个“无法解析远程名称:https://jsonplaceholder.typicode.com/posts"。该接口工作正常,因为我可以通过Postman向它发出请求。我正在使用BC16,在一个应该代表SaaS环境的docker容器中。你知道为什么我会得到这个错误吗?请求代码如下:
local procedure SendHTTPRequest()
var
client: HttpClient;
responseMessage: HttpResponseMessage;
begin
client.Get('https://jsonplaceholder.typicode.com/posts');
Message(Format(responseMessage.HttpStatusCode));
end;发布于 2020-12-18 15:16:16
您应该确保已为您的分机启用HttpClient请求。
为此,您必须执行以下操作:
three on>转到extension
Configure
Configure
Allow HttpClient Requests is onhttps://stackoverflow.com/questions/65286612
复制相似问题