GetHttpVersion
PowerScript function
Description
Gets the HTTP protocol version used in communication. This function
should be used only when the request is sent successfully, otherwise, the
protocol version returned is not the actual protocol version.
Applies to
HTTPClient, RestClient, TokenResponse, ResourceResponse
objects
Syntax
|
1 |
objectname.GetHttpVersion ( ) |
|
Argument |
Description |
|---|---|
|
objectname |
The name of the object for which you want to get the HTTP |
Return value
String.
Returns the version of the HTTP protocol currently in use.
“HTTP 1.1” — The protocol currently used is HTTP 1.1.
“HTTP 2.0” — The protocol currently used is HTTP 2.0.
Examples
This example gets the HTTP protocol version through an HTTPClient
object:
|
1 2 3 4 5 6 |
l_httpclient.enableHttp2= true l_httpclient.SendRequest("GET", "https://test.appeon.com") ls_version = l_httpclient.GetHttpVersion() if ls_version = "HTTP 2.0" Then // … End If |
This example gets the HTTP protocol version through a RESTClient
object:
|
1 2 3 4 5 6 |
l_restclient.enableHttp2= true l_restclient.SendGetRequest("https://test.appeon.com") ls_version = l_restclient.GetHttpVersion() if ls_version = "HTTP 2.0" Then // … End If |
This example gets the HTTP protocol version through a TokenResponse
object:
|
1 2 3 4 5 |
ln_rtn = inv_OAuthClient.AccessToken(lnv_TokenRequest, lnv_TokenResponse) ls_version = lnv_TokenResponse.GetHttpVersion() if ls_version = "HTTP 2.0" Then // … End If |
This example gets the HTTP protocol version through a
ResourceResponse object:
|
1 2 3 4 5 |
ln_rtn = inv_OAuthClient.RequestResource(lnv_OAuthRequest, lnv_ResourceResponse) ls_version = lnv_ResourceResponse.GetHttpVersion() if ls_version = "HTTP 2.0" Then // … End If |