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

  • Constructors: Not applicable.

1.1. httpGet method

Supported APIs

HttpClientV2.httpGet method is compatible with the following com.ibm.security.access.httpclient.HttpClientV2.httpGet
methods.

ModifierReturn TypeMethod
staticHttpResponsehttpGet(java.lang.String urlstr)
staticHttpResponsehttpGet(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)
staticHttpResponsehttpGet(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)
staticHttpResponsehttpGet(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)
staticHttpResponsehttpGet(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.

ModifierReturn TypeMethod
staticHttpResponsehttpGet(RequestParameters params)
staticHttpResponsehttpGet(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

Supported APIs

HttpClientV2.httpPut method is compatible with the following com.ibm.security.access.httpclient.HttpClientV2.httpPut methods.

ModifierReturn TypeMethod
staticHttpResponsehttpPut(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)
staticHttpResponsehttpPut(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)
staticHttpResponsehttpPut(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)
staticHttpResponsehttpPut(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.

ModifierReturn TypeMethod
staticHttpResponsehttpPut(RequestParameters params)
staticHttpResponsehttpPut(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)
staticHttpResponsehttpPut(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)
staticHttpResponsehttpPut(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)
staticHttpResponsehttpPut(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)
staticHttpResponsehttpPut(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)
staticHttpResponsehttpPut(java.lang.String urlstr, Parameters params)
staticHttpResponsehttpPut(java.lang.String urlstr, Parameters params, boolean sendDataAsJson)

1.3. httpPost method

Supported APIs

HttpClientV2.httpPost method is compatible with the
following com.ibm.security.access.httpclient.HttpClientV2.httpPost methods.

ModifierReturn TypeMethod
staticHttpResponsehttpPost(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)
staticHttpResponsehttpPost(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)
staticHttpResponsehttpPost(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)
staticHttpResponsehttpPost(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)
staticHttpResponsehttpPost(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.

ModifierReturn TypeMethod
staticHttpResponsehttpPost(RequestParameters params)
staticHttpResponsehttpPost(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)
staticHttpResponsehttpPost(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)
staticHttpResponsehttpPost(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)
staticHttpResponsehttpPost(java.lang.String urlstr, Parameters params)
staticHttpResponsehttpPost(java.lang.String urlstr, Parameters params, boolean sendDataAsJson)

1.4. httpPatch Method

Supported APIs

HttpClientV2.httpPatch method is compatible with the
following com.ibm.security.access.httpclient.HttpClientV2.httpPatch methods.

ModifierReturn TypeMethod
staticHttpResponsehttpPatch(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)
staticHttpResponsehttpPatch(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)
staticHttpResponsehttpPatch(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.

ModifierReturn TypeMethod
staticHttpResponsehttpPatch(RequestParameters params)
staticHttpResponsehttpPatch(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)
staticHttpResponsehttpPatch(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)
staticHttpResponsehttpPatch(java.lang.String urlstr, Parameters params)
staticHttpResponsehttpPatch(java.lang.String urlstr, Parameters params, boolean sendDataAsJson)

1.5. httpDelete method

Supported APIs

HttpClientV2.httpDelete method is compatible with the
following com.ibm.security.access.httpclient.HttpClientV2.httpDelete methods.

ModifierReturn TypeMethod
staticHttpResponsehttpDelete(java.lang.String urlstr)
staticHttpResponsehttpDelete(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)
staticHttpResponsehttpDelete(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.

ModifierReturn TypeMethod
staticHttpResponsehttpDelete(RequestParameters params)
staticHttpResponsehttpDelete(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)
staticHttpResponsehttpDelete(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

  • Constructors: Not applicable.
  • Supported methods: getBody, getCode, getHeaderKeys, getHeaders, getHeaderValues are supported by HttpResponse with the same input arguments as com.ibm.security.access.httpclient.HttpResponse.
    See Input Argument and Return Value Type Differences for return type differences
  • Unsupported methods: toString is NOT supported by HttpResponse
  • New methods: HttpResponse provides these new methods hasError, getError

3. 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 by Headers and have the same input arguments as com.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

  • 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 by Parameters and have the same input arguments as com.ibm.security.access.httpclient.Parameters.
    See Input Argument and Return Value Type Differences for return type differences.

5. RequestParameters

RequestParameters is not supported. No implementation exists that corresponds to com.ibm.security.access.httpclient.RequestParameters.