EnableHttp2

Applies to

HTTPClient, RestClient, TokenRequest, OAuthRequest

Description

When the EnableHttp2 property is set to True, the HTTP/2 connection is used when sending requests. The default value is TRUE.

In the environment where HTTP/2 is not well supported, the system will fall back to HTTP/1.1 and continue the transaction.

Usage

The EnableHttp2 property takes a boolean value. The following examples send requests using the HTTP/2 connection.

l_httpclient.enableHttp2= true
l_httpclient.SendRequest("GET", "https://test.appeon.com")
l_restclient.enableHttp2= true
l_restclient.SendGetRequest("https://test.appeon.com")
lnv_TokenRequest.enableHttp2= true
lnv_TokenRequest.TokenLocation = "https://test.appeon.com"
lnv_TokenRequest.Method = "POST"
lnv_TokenRequest.GrantType = "client_credentials"
lnv_TokenRequest.ClientId = "Af-Bf-ZPrD0j1aXrGRsnAgx2-rcuE-ZTQOr9mEvqsi"
lnv_TokenRequest.ClientSecret= "EH2OWHgxMgyKc-tN_EGZAh0Kg4-XS8AQi26vEJh"
ln_rtn = inv_OAuthClient.AccessToken(lnv_TokenRequest, lnv_TokenResponse)
lnv_OAuthRequest.enableHttp2= true
lnv_OAuthRequest.Method = "GET"
lnv_OAuthRequest.URL = "https://test.appeon.com/product/100"
lnv_OAuthRequest.SetAccessToken(ls_AccessToken)
ln_rtn = inv_OAuthClient.RequestResource(lnv_OAuthRequest, lnv_ResourceResponse)