MB-820 practice question 11 of 25
A company has a Business Central online environment. You need to create an HTTP GET request that connects to an external REST service. Which solution should you use?
Full set: 116 questionsDomain Configure Microsoft Dynamics 365 Business Central
The HttpClient data type is the standard and recommended component in the AL language for sending HTTP requests and receiving responses from external web services. It provides specific methods for different HTTP verbs, including a .Get() method designed explicitly for making HTTP GET requests. To connect to an external REST service, a developer would instantiate an HttpClient variable and use its methods to perform the required communication. This is the most direct and modern approach within Business Central for this task.
A. The HttpContent data type is used to represent the body or payload of an HTTP request (e.g., for POST or PUT), not to initiate the request itself.
B. Codeunit 1299 "Web Request Helper" is a wrapper/helper object. The fundamental and recommended approach is to use the HttpClient data type directly for better control and clarity.
C. Codeunit S459 "JSON Management" is used for creating, parsing, and manipulating JSON data structures, not for performing the actual network communication via HTTP.
D. Codeunit 1297 "Http Web Request Mgt" is a legacy helper codeunit. The HttpClient data type is the current, more powerful, and recommended tool for HTTP communication.
1. Microsoft Learn: "HttpClient Data Type".
Section: Remarks.
Content: "Provides a data type for sending HTTP requests and receiving HTTP responses from a resource identified by a URI." This document explicitly states that HttpClient is the primary data type for this purpose and provides examples of using the .Get() method.
2. Microsoft Learn: "Calling external web services with the HttpClient data type in AL".
Section: "Example: Making a GET request".
Content: This tutorial demonstrates the end-to-end process, starting with the declaration of an HttpClient variable (Client: HttpClient;) to make a GET request to a REST API.
3. Microsoft Learn: "HttpContent Data Type".
Section: Remarks.
Content: "Represents the body of the HTTP request message." This confirms that HttpContent is for the payload, not the client sending the request.
Keep practicing
Take the free MB-820 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other MB-820 practice questions
- Question 8You need to determine why the debugger does not start correctly. What is the cause of the…
- Question 13You need to create the access modifier for IssueTotal. Which variable declaration should …
- Question 17You need to improve performance when ticketAPI is used to analyze the POS data. What shou…
- Question 22You create a Business Central report. You need to insert values on the Request page to be…
- Question 25You need to define the data types for the fields of the N on-conformity table. Which two …
