bcquality/microsoft/knowledge/web-services/handle-httpclient-platform-failure-before-response-access.good.al
demiliani 45ca57a23e Strengthen review contracts and HTTP guidance
- add outbound HttpClient transport and HTTP status review rules with paired fixtures`n- resolve layered action-skill overrides deterministically across enabled layers`n- validate findings reports and enforce measurable changed-fixture coverage
2026-09-23 15:31:21 +02:00

18 lines
No EOL
502 B
AL

codeunit 50100 "Http Platform Failure Good"
{
procedure GetCustomer(CustomerId: Guid): Text
var
Client: HttpClient;
Response: HttpResponseMessage;
ResponseText: Text;
begin
if not Client.Get(
StrSubstNo('https://api.example.com/customers/%1', CustomerId),
Response)
then
Error('The customer service could not be reached.');
Response.Content().ReadAs(ResponseText);
exit(ResponseText);
end;
}