mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 22:56:55 +01:00
- 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
23 lines
No EOL
733 B
AL
23 lines
No EOL
733 B
AL
codeunit 50100 "HTTP Status Handling Good"
|
|
{
|
|
procedure GetCustomer(CustomerId: Guid): JsonObject
|
|
var
|
|
Client: HttpClient;
|
|
Response: HttpResponseMessage;
|
|
CustomerJson: JsonObject;
|
|
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.');
|
|
|
|
if not Response.IsSuccessStatusCode() then
|
|
Error('The customer service returned HTTP status %1.', Response.HttpStatusCode());
|
|
|
|
Response.Content().ReadAs(ResponseText);
|
|
CustomerJson.ReadFrom(ResponseText);
|
|
exit(CustomerJson);
|
|
end;
|
|
} |