Class HttpClient
java.lang.Object
com.ibm.security.access.httpclient.HttpClient
Implementation of a HTTP Client. Relies on com.tivoli.am.fim.soap.client
implementation of HttpClient.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpResponse
httpDelete
(String urlstr, Headers headers, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol) HTTP client DELETE method.static HttpResponse
HTTP client GET method.static HttpResponse
httpGet
(String urlstr, Headers headers, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias) HTTP client GET method.static HttpResponse
httpGet
(String urlstr, Headers headers, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol) HTTP client GET method.static HttpResponse
httpGet
(String urlstr, Headers headers, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol, boolean throwExec, int timeout) HTTP client GET method.static HttpResponse
httpGet
(String urlstr, Headers headers, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol, int timeout) HTTP client GET method.static HttpResponse
httpPatch
(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol) static HttpResponse
httpPost
(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias) HTTP client POST method.static HttpResponse
httpPost
(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol) HTTP client POST method.static HttpResponse
httpPost
(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol, boolean throwException, int timeout) HTTP client POST method.static HttpResponse
httpPost
(String urlstr, Headers headers, String body, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias) HTTP client POST method.static HttpResponse
httpPost
(String urlstr, Headers headers, String body, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, int timeout) HTTP client POST method.static HttpResponse
httpPost
(String urlstr, Parameters params) HTTP client POST method.static HttpResponse
httpPut
(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias) HTTP client PUT method.static HttpResponse
httpPut
(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol) HTTP client PUT method.static HttpResponse
httpPut
(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol, int timeout) HTTP client PUT method.static HttpResponse
httpPut
(String urlstr, Headers headers, String body, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias) HTTP client PUT method.static HttpResponse
httpPut
(String urlstr, Headers headers, String body, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, int timeout) HTTP client PUT method.static HttpResponse
httpPut
(String urlstr, Parameters params) HTTP client PUT method.
-
Field Details
-
HttpClient_java_sourceCodeID
- See Also:
-
HttpClient_java_copyright
- See Also:
-
SPECIAL_BODY_PARAM
- See Also:
-
-
Constructor Details
-
HttpClient
public HttpClient()
-
-
Method Details
-
httpGet
HTTP client GET method.- Parameters:
urlstr
- URL- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpGet
public static HttpResponse httpGet(String urlstr, Headers headers, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias) HTTP client GET method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.httpsTrustStore
- The name of the trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpGet
public static HttpResponse httpGet(String urlstr, Headers headers, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol) HTTP client GET method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.httpsTrustStore
- The name of the trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.protocol
- SSL protocol to use for this connection. Valid values are: TLS, TLSv1, TLSv1.1, TLSv1.2. If not provided the value of the advanced configuration property 'util.httpClient.defaultSSLProtocol' will be used. FIPS and NIST mode will override this value.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpGet
public static HttpResponse httpGet(String urlstr, Headers headers, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol, int timeout) HTTP client GET method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.httpsTrustStore
- The name of the trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.protocol
- SSL protocol to use for this connection. Valid values are: TLS, TLSv1, TLSv1.1, TLSv1.2. If not provided the value of the advanced configuration property 'util.httpClient.defaultSSLProtocol' will be used. FIPS and NIST mode will override this value.timeout
- Request timeout in seconds- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpGet
public static HttpResponse httpGet(String urlstr, Headers headers, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol, boolean throwExec, int timeout) HTTP client GET method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.httpsTrustStore
- The name of the trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.protocol
- SSL protocol to use for this connection. Valid values are: TLS, TLSv1, TLSv1.1, TLSv1.2. If not provided the value of the advanced configuration property 'util.httpClient.defaultSSLProtocol' will be used. FIPS and NIST mode will override this value.throwExec
- If an exception should be raised, or handledtimeout
- Request timeout in seconds- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPost
HTTP client POST method.- Parameters:
urlstr
- URLparams
- Parameters to be added to the request body.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPost
public static HttpResponse httpPost(String urlstr, Headers headers, String body, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias) HTTP client POST method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.body
- A String representation of the HTTP POST BodyhttpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPost
public static HttpResponse httpPost(String urlstr, Headers headers, String body, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, int timeout) HTTP client POST method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.body
- A String representation of the HTTP POST BodyhttpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.timeout
- Request timeout in seconds- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPost
public static HttpResponse httpPost(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias) HTTP client POST method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.params
- Parameters to be added to the request body.httpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPost
public static HttpResponse httpPost(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol) HTTP client POST method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.params
- Parameters to be added to the request body.httpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.protocol
- SSL protocol to use for this connection. Valid values are: TLS, TLSv1, TLSv1.1, TLSv1.2. If not provided the value of the advanced configuration property 'util.httpClient.defaultSSLProtocol' will be used. FIPS and NIST mode will override this value.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPost
public static HttpResponse httpPost(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol, boolean throwException, int timeout) HTTP client POST method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.params
- Parameters to be added to the request body.httpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.protocol
- SSL protocol to use for this connection. Valid values are: TLS, TLSv1, TLSv1.1, TLSv1.2. If not provided the value of the advanced configuration property 'util.httpClient.defaultSSLProtocol' will be used. FIPS and NIST mode will override this value.throwException
- If an exception should be raised, or handledtimeout
- Request timeout in seconds- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPut
HTTP client PUT method.- Parameters:
urlstr
- URLparams
- Parameters to be added to the request body.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPut
public static HttpResponse httpPut(String urlstr, Headers headers, String body, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias) HTTP client PUT method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.body
- A String representation of the HTTP PUT BodyhttpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPut
public static HttpResponse httpPut(String urlstr, Headers headers, String body, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, int timeout) HTTP client PUT method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.body
- A String representation of the HTTP PUT BodyhttpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.timeout
- Request timeout in seconds- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPut
public static HttpResponse httpPut(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias) HTTP client PUT method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.params
- Parameters to be added to the request body.httpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPut
public static HttpResponse httpPut(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol) HTTP client PUT method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.params
- Parameters to be added to the request body.httpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.protocol
- SSL protocol to use for this connection. Valid values are: TLS, TLSv1, TLSv1.1, TLSv1.2. If not provided the value of the advanced configuration property 'util.httpClient.defaultSSLProtocol' will be used. FIPS and NIST mode will override this value.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPut
public static HttpResponse httpPut(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol, int timeout) HTTP client PUT method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.params
- Parameters to be added to the request body.httpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.protocol
- SSL protocol to use for this connection. Valid values are: TLS, TLSv1, TLSv1.1, TLSv1.2. If not provided the value of the advanced configuration property 'util.httpClient.defaultSSLProtocol' will be used. FIPS and NIST mode will override this value.timeout
- Request timeout in seconds- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpPatch
public static HttpResponse httpPatch(String urlstr, Headers headers, Parameters params, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol) - Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.params
- Parameters to be added to the request body.httpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.protocol
- SSL protocol to use for this connection. Valid values are: TLS, TLSv1, TLSv1.1, TLSv1.2. If not provided the value of the advanced configuration property 'util.httpClient.defaultSSLProtocol' will be used. FIPS and NIST mode will override this value.- Returns:
- The HTTP response. Null if invalid URL or no response.
-
httpDelete
public static HttpResponse httpDelete(String urlstr, Headers headers, String httpsTrustStore, String basicAuthUsername, String basicAuthPassword, String clientKeyStore, String clientKeyAlias, String protocol) HTTP client DELETE method.- Parameters:
urlstr
- URLheaders
- Headers to be added to the request header.httpsTrustStore
- The trust store to use. If a HTTPS connection is required and this is set to NULL, the default trust store specified in the override configs will be used.basicAuthUsername
- Basic-auth username. If null, basic-auth will be disabled.basicAuthPassword
- Basic-auth password. If null, basic-auth will be disabled.clientKeyStore
- Client key store. If null, client cert auth will be disabled.clientKeyAlias
- Client key alias. If null, client cert auth will be disabled.protocol
- SSL protocol to use for this connection. Valid values are: TLS, TLSv1, TLSv1.1, TLSv1.2. If not provided the value of the advanced configuration property 'util.httpClient.defaultSSLProtocol' will be used. FIPS and NIST mode will override this value.- Returns:
- The HTTP response. Null if invalid URL or no response.
-