类 InterceptingHttpAccessor
- java.lang.Object
- org.springframework.http.client.support.HttpAccessor
- org.springframework.http.client.support.InterceptingHttpAccessor
- 直接已知子类:
RestTemplate
public abstract class InterceptingHttpAccessor extends HttpAccessor
Base class forRestTemplate
and other HTTP accessing gateway helpers, adding interceptor-related properties toHttpAccessor
's common properties.Not intended to be used directly. See
RestTemplate
for an entry point.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma, Juergen Hoeller
- 另请参阅:
ClientHttpRequestInterceptor
,InterceptingClientHttpRequestFactory
,RestTemplate
字段概要
从类继承的字段 org.springframework.http.client.support.HttpAccessor
logger
构造器概要
构造器 构造器 说明 InterceptingHttpAccessor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 List<ClientHttpRequestInterceptor>
getInterceptors()
Get the request interceptors that this accessor uses.ClientHttpRequestFactory
getRequestFactory()
Overridden to expose anInterceptingClientHttpRequestFactory
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.从类继承的方法 org.springframework.http.client.support.HttpAccessor
createRequest, getClientHttpRequestInitializers, setClientHttpRequestInitializers
构造器详细资料
InterceptingHttpAccessor
public InterceptingHttpAccessor()
方法详细资料
setInterceptors
public void setInterceptors(List<ClientHttpRequestInterceptor> interceptors)
Set the request interceptors that this accessor should use.The interceptors will get immediately sorted according to their order.
getInterceptors
public List<ClientHttpRequestInterceptor> getInterceptors()
Get the request interceptors that this accessor uses.The returned
List
is active and may be modified. Note, however, that the interceptors will not be resorted according to their order before theClientHttpRequestFactory
is built.
setRequestFactory
public void setRequestFactory(ClientHttpRequestFactory requestFactory)
Set the request factory that this accessor uses for obtaining client request handles.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.
getRequestFactory
public ClientHttpRequestFactory getRequestFactory()
Overridden to expose anInterceptingClientHttpRequestFactory
if necessary.- 覆盖:
getRequestFactory
在类中HttpAccessor
- 另请参阅:
getInterceptors()