HttpClient Data Type

Version: Available or changed with runtime version 1.0.

Provides a data type for sending HTTP requests and receiving HTTP responses from a resource identified by a URI.

The following methods are available on instances of the HttpClient data type.

Method name Description
AddCertificate(String [, String]) Adds a certificate to the HttpClient class.
Clear() Sets the HttpClient variable to the default value.
DefaultRequestHeaders() Gets the default request headers which should be sent with each request.
Delete(String, var HttpResponseMessage) Sends a DELETE request to delete the resource identified by the request URL.
Get(String, var HttpResponseMessage) Sends a GET request to get the resource identified by the request URL.
GetBaseAddress() Gets the base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests.
Post(String, HttpContent, var HttpResponseMessage) Sends a POST request to the specified URI as an asynchronous operation.
Put(String, HttpContent, var HttpResponseMessage) Sends a PUT request to the specified URI as an asynchronous operation.
Send(HttpRequestMessage, var HttpResponseMessage) Sends an HTTP request as an asynchronous operation.
SetBaseAddress(String) Sets the base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests.
Timeout([Duration]) Gets or sets the duration in milliseconds to wait before the request times out.
UseDefaultNetworkWindowsAuthentication() Sets the HttpClient credentials to use the default network credentials for Windows authentication. If this method is invoked after any HTTP request has started; a runtime error occurs.
UseWindowsAuthentication(String, String [, String]) Sets the HttpClient credentials to use the specified network credentials for Windows authentication. If this method is invoked after any HTTP request has started; a runtime error occurs.

Remarks

The supported security protocols are controlled by the SecurityProtocol configuration setting. For more information, see Microsoft Dynamics 365 Business Central Server Configuration.

See Also

Getting Started with AL
Developing Extensions