HttpClient differences with ISVA
Differences between httpclient utilities and the traditional Verify Access httpclient utilities classes
Input argument and return value type differences
1. List type
A JS array is used instead of a java.util.List
.
-
Input argument: use JavaScript array to create the variable.
let header = new Headers(); header.addHeader("header1", ["value1", "value2", "value3"]); // do something
-
Return value: access the return values as JavaScript array
// assume resp is the a HttpResponse object returned by a HttpClientV2 method if (resp.getError()) { // handle error } else { // get response header names as a list let headerKeys = resp.getHeaderKeys(); if (headerKeys != null) { for (var i = 0; i < headerKeys.length; i++) { let headerValues = resp.getHeaderValues(getHeaderheaderKeys[i]); // Do something... } } }
2. Map type
A JS object is used instead of a java.util.Map
.
-
Input argument:
HttpClientV2
classes do not have a map type input argument -
Return value: access the return values as a JavaScript object
// assume resp is the a HttpResponse object returned by a HttpClientV2 method if (resp.getError()) { // handle error } else { // get all response headers as a map let headers = resp.getHeaders(); if (headers != null) { let contentType = headers["Content-Type"]; // do something } }
API differences
1. HttpClientV2
compared to com.ibm.security.access.httpclient.HttpClientV2.httpGet
HttpClientV2
compared to com.ibm.security.access.httpclient.HttpClientV2.httpGet
- Constructors: Not applicable.
1.1. httpGet
method
httpGet
methodSupported APIs
HttpClientV2.httpGet
method is compatible with the following com.ibm.security.access.httpclient.HttpClientV2.httpGet
methods.
Modifier | Return Type | Method |
---|---|---|
static | HttpResponse | httpGet(java.lang.String urlstr) |
static | HttpResponse | httpGet(java.lang.String urlstr, Headers headers, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias) |
static | HttpResponse | httpGet(java.lang.String urlstr, Headers headers, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol) |
static | HttpResponse | httpGet(java.lang.String urlstr, Headers headers, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, boolean throwExec, int timeout) |
static | HttpResponse | httpGet(java.lang.String urlstr, Headers headers, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, boolean throwExec, int timeout, java.lang.String proxyServer) |
Unsupported APIs
HttpClientV2.httpGet
method is NOT compatible with the
following com.ibm.security.access.httpclient.HttpClientV2.httpGet
methods.
Modifier | Return Type | Method |
---|---|---|
static | HttpResponse | httpGet(RequestParameters params) |
static | HttpResponse | httpGet(java.lang.String urlstr, Headers headers, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, int timeout) |
1.2. httpPut
method
httpPut
methodSupported APIs
HttpClientV2.httpPut
method is compatible with the following com.ibm.security.access.httpclient.HttpClientV2.httpPut
methods.
Modifier | Return Type | Method |
---|---|---|
static | HttpResponse | httpPut(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias) |
static | HttpResponse | httpPut(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol) |
static | HttpResponse | httpPut(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, boolean throwException, int timeout, boolean sendDataAsJson, java.lang.String proxyServer) |
static | HttpResponse | httpPut(java.lang.String urlstr, Headers headers, java.lang.String body, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias) |
Unsupported APIs
HttpClientV2.httpPut
method is NOT compatible with the following com.ibm.security.access.httpclient.HttpClientV2.httpPut
methods.
Modifier | Return Type | Method |
---|---|---|
static | HttpResponse | httpPut(RequestParameters params) |
static | HttpResponse | httpPut(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, boolean sendDataAsJson) |
static | HttpResponse | httpPut(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, boolean sendDataAsJson) |
static | HttpResponse | httpPut(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, int timeout, boolean sendDataAsJson) |
static | HttpResponse | httpPut(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, int timeout, boolean sendDataAsJson, java.lang.String proxyServer) |
static | HttpResponse | httpPut(java.lang.String urlstr, Headers headers, java.lang.String body, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, int timeout) |
static | HttpResponse | httpPut(java.lang.String urlstr, Parameters params) |
static | HttpResponse | httpPut(java.lang.String urlstr, Parameters params, boolean sendDataAsJson) |
1.3. httpPost
method
httpPost
methodSupported APIs
HttpClientV2.httpPost
method is compatible with the
following com.ibm.security.access.httpclient.HttpClientV2.httpPost
methods.
Modifier | Return Type | Method |
---|---|---|
static | HttpResponse | httpPost(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias) |
static | HttpResponse | httpPost(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol) |
static | HttpResponse | httpPost(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, boolean throwException, int timeout, boolean sendDataAsJson) |
static | HttpResponse | httpPost(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, boolean throwException, int timeout, boolean sendDataAsJson, java.lang.String proxyServer) |
static | HttpResponse | httpPost(java.lang.String urlstr, Headers headers, java.lang.String body, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias) |
Unsupported APIs
HttpClientV2.httpPost
method is NOT compatible with the
following com.ibm.security.access.httpclient.HttpClientV2.httpPost
methods.
Modifier | Return Type | Method |
---|---|---|
static | HttpResponse | httpPost(RequestParameters params) |
static | HttpResponse | httpPost(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, boolean sendDataAsJson) |
static | HttpResponse | httpPost(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, boolean sendDataAsJson) |
static | HttpResponse | httpPost(java.lang.String urlstr, Headers headers, java.lang.String body, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, int timeout) |
static | HttpResponse | httpPost(java.lang.String urlstr, Parameters params) |
static | HttpResponse | httpPost(java.lang.String urlstr, Parameters params, boolean sendDataAsJson) |
1.4. httpPatch
Method
httpPatch
MethodSupported APIs
HttpClientV2.httpPatch
method is compatible with the
following com.ibm.security.access.httpclient.HttpClientV2.httpPatch
methods.
Modifier | Return Type | Method |
---|---|---|
static | HttpResponse | httpPatch(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol) |
static | HttpResponse | httpPatch(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, boolean throwException, int timeout, boolean sendDataAsJson, java.lang.String proxyServer) |
static | HttpResponse | httpPatch(java.lang.String urlstr, Headers headers, java.lang.String body, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol) |
Unsupported APIs
HttpClientV2.httpPatch
method is NOT compatible with the
following com.ibm.security.access.httpclient.HttpClientV2.httpPatch
methods.
Modifier | Return Type | Method |
---|---|---|
static | HttpResponse | httpPatch(RequestParameters params) |
static | HttpResponse | httpPatch(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, int timeout, boolean sendDataAsJson) |
static | HttpResponse | httpPatch(java.lang.String urlstr, Headers headers, Parameters params, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, int timeout, boolean sendDataAsJson, java.lang.String proxyServer) |
static | HttpResponse | httpPatch(java.lang.String urlstr, Parameters params) |
static | HttpResponse | httpPatch(java.lang.String urlstr, Parameters params, boolean sendDataAsJson) |
1.5. httpDelete
method
httpDelete
methodSupported APIs
HttpClientV2.httpDelete
method is compatible with the
following com.ibm.security.access.httpclient.HttpClientV2.httpDelete
methods.
Modifier | Return Type | Method |
---|---|---|
static | HttpResponse | httpDelete(java.lang.String urlstr) |
static | HttpResponse | httpDelete(java.lang.String urlstr, Headers headers, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol) |
static | HttpResponse | httpDelete(java.lang.String urlstr, Headers headers, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, boolean throwException, int timeout, java.lang.String proxyServer) |
Unsupported APIs
HttpClientV2.httpDelete
method is NOT compatible with the following com.ibm.security.access.httpclient.HttpClientV2.httpDelete
methods.
Modifier | Return Type | Method |
---|---|---|
static | HttpResponse | httpDelete(RequestParameters params) |
static | HttpResponse | httpDelete(java.lang.String urlstr, Headers headers, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, int timeout) |
static | HttpResponse | httpDelete(java.lang.String urlstr, Headers headers, java.lang.String httpsTrustStore, java.lang.String basicAuthUsername, java.lang.String basicAuthPassword, java.lang.String clientKeyStore, java.lang.String clientKeyAlias, java.lang.String protocol, int timeout, java.lang.String proxyServer) |
1.6. Other unsupported method
httpHead
httpOptions
httpTrace
are NOT supported by HttpClientV2
2. HttpResponse
vs com.ibm.security.access.httpclient.HttpResponse
HttpResponse
vs com.ibm.security.access.httpclient.HttpResponse
- Constructors: Not applicable.
- Supported methods:
getBody
,getCode
,getHeaderKeys
,getHeaders
,getHeaderValues
are supported byHttpResponse
with the same input arguments ascom.ibm.security.access.httpclient.HttpResponse
.
See Input Argument and Return Value Type Differences for return type differences - Unsupported methods:
toString
is NOT supported byHttpResponse
- New methods:
HttpResponse
provides these new methodshasError
,getError
3. Headers
compared to com.ibm.security.access.httpclient.Headers
Headers
compared to com.ibm.security.access.httpclient.Headers
- Constructors: No differences exist between
com.ibm.security.access.httpclient.Headers
. - Supported methods: All methods in
com.ibm.security.access.httpclient.Headers
are supported byHeaders
and have the same input arguments ascom.ibm.security.access.httpclient.Headers
.
See Input Argument and Return Value Type Differences for return type differences.
4. Parameters
compared to com.ibm.security.access.httpclient.Parameters
Parameters
compared to com.ibm.security.access.httpclient.Parameters
- Constructors:
Parameters
support default constructor only. A constructor with initial values is NOT supported. - Supported methods: All methods in
com.ibm.security.access.httpclient.Parameters
are supported byParameters
and have the same input arguments ascom.ibm.security.access.httpclient.Parameters
.
See Input Argument and Return Value Type Differences for return type differences.
5. RequestParameters
RequestParameters
RequestParameters
is not supported. No implementation exists that corresponds to com.ibm.security.access.httpclient.RequestParameters
.
Updated about 2 years ago