BasicAuthenticationInterceptor
which reuses HttpHeaders.setBasicAuth(java.lang.String, java.lang.String)
,
sharing its default charset ISO-8859-1 instead of UTF-8 as used here@Deprecated public class BasicAuthorizationInterceptor extends Object implements ClientHttpRequestInterceptor
ClientHttpRequestInterceptor
to apply a BASIC authorization header.Constructor and Description |
---|
BasicAuthorizationInterceptor(String username,
String password)
Deprecated.
Create a new interceptor which adds a BASIC authorization header
for the given username and password.
|
Modifier and Type | Method and Description |
---|---|
ClientHttpResponse |
intercept(HttpRequest request,
byte[] body,
ClientHttpRequestExecution execution)
Deprecated.
Intercept the given request, and return a response.
|
public BasicAuthorizationInterceptor(@Nullable String username, @Nullable String password)
username
- the username to usepassword
- the password to usepublic ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException
ClientHttpRequestInterceptor
ClientHttpRequestExecution
allows the interceptor to pass on the
request and response to the next entity in the chain.
A typical implementation of this method would follow the following pattern:
ClientHttpRequestExecution.execute(org.springframework.http.HttpRequest, byte[])
,intercept
in interface ClientHttpRequestInterceptor
request
- the request, containing method, URI, and headersbody
- the body of the requestexecution
- the request executionIOException
- in case of I/O errors