Module org.cruk.clarity.api
Package org.cruk.clarity.api.http
Interface AuthenticatingClientHttpRequestFactory
- All Superinterfaces:
ClientHttpRequestFactory
- All Known Implementing Classes:
HttpComponentsClientHttpRequestFactoryBasicAuth
Extension of the ClientHttpRequestFactory interface to allow
authentication to be used with the REST client.
- Since:
- 2.23.1
-
Method Summary
Modifier and TypeMethodDescriptionGet the credentials currently in use.getHost()
Get the host to which the credentials will be applied.void
setCredentials
(URL url, Credentials credentials) Set the credentials based on the protocol, host and port in the URL.void
setCredentials
(HttpHost host, Credentials credentials) Set the credentials based on the HTTP host specification.Methods inherited from interface org.springframework.http.client.ClientHttpRequestFactory
createRequest
-
Method Details
-
getHost
HttpHost getHost()Get the host to which the credentials will be applied.- Returns:
- The HttpHost specification to which the authentication applies.
-
getCredentials
Credentials getCredentials()Get the credentials currently in use.- Returns:
- The credentials.
-
setCredentials
Set the credentials based on the protocol, host and port in the URL.- Parameters:
url
- The URL of the HTTP server.credentials
- The credentials to use, or null to reset.- Throws:
IllegalArgumentException
- ifurl
is null.
-
setCredentials
Set the credentials based on the HTTP host specification.- Parameters:
host
- The host specification of the HTTP server.credentials
- The credentials to use, or null to reset.- Throws:
IllegalArgumentException
- ifhost
is null.
-