public abstract class InterceptingHttpAccessor extends HttpAccessor
RestTemplate
and other HTTP accessing gateway helpers, adding interceptor-related
properties to HttpAccessor
's common properties.
Not intended to be used directly.
See RestTemplate
for an entry point.
ClientHttpRequestInterceptor
,
InterceptingClientHttpRequestFactory
,
RestTemplate
logger
Constructor and Description |
---|
InterceptingHttpAccessor() |
Modifier and Type | Method and Description |
---|---|
List<ClientHttpRequestInterceptor> |
getInterceptors()
Get the request interceptors that this accessor uses.
|
ClientHttpRequestFactory |
getRequestFactory()
Overridden to expose an
InterceptingClientHttpRequestFactory
if necessary. |
void |
setInterceptors(List<ClientHttpRequestInterceptor> interceptors)
Set the request interceptors that this accessor should use.
|
void |
setRequestFactory(ClientHttpRequestFactory requestFactory)
Set the request factory that this accessor uses for obtaining client request handles.
|
createRequest, getClientHttpRequestInitializers, setClientHttpRequestInitializers
public void setInterceptors(List<ClientHttpRequestInterceptor> interceptors)
The interceptors will get immediately sorted according to their order.
public List<ClientHttpRequestInterceptor> getInterceptors()
The returned List
is active and may be modified. Note,
however, that the interceptors will not be resorted according to their
order before the
ClientHttpRequestFactory
is built.
public void setRequestFactory(ClientHttpRequestFactory requestFactory)
The default is a SimpleClientHttpRequestFactory
based on the JDK's own
HTTP libraries (HttpURLConnection
).
Note that the standard JDK HTTP library does not support the HTTP PATCH method. Configure the Apache HttpComponents or OkHttp request factory to enable PATCH.
public ClientHttpRequestFactory getRequestFactory()
InterceptingClientHttpRequestFactory
if necessary.getRequestFactory
in class HttpAccessor
getInterceptors()