HttpClient.UseResponseCookies(Boolean) Method

Version: Available or changed with runtime version 13.0.

If true, the client automatically attaches cookies received in the response to all subsequent requests.

Syntax

 HttpClient.UseResponseCookies(UseResponseCookies: Boolean)

Parameters

HttpClient
 Type: HttpClient
An instance of the HttpClient data type.

UseResponseCookies
 Type: Boolean
True to automatically attach cookies received in the response to all subsequent requests. False to disable.

Remarks

The HttpClient.UseResponseCookies method allows you to specify whether the client should automatically attach cookies received in the response to all subsequent requests. If you set the UseResponseCookies parameter to true, the client automatically attaches cookies received in the response to all subsequent requests. If you set the UseResponseCookies parameter to false, the client doesn't automatically attach cookies received in the response to all subsequent requests.

// Example of enabling and disabling cookie caching

local procedure UseResponseCookiesExample()
var
    Client: HttpClient;
begin
    // Enable cookie caching
    Client.UseResponseCookies(true);

    // Disable cookie caching
    Client.UseResponseCookies(false);
end;

HttpClient Data Type
Getting Started with AL
Developing Extensions