接口的使用
org.springframework.http.client.ClientHttpRequestInterceptor
使用ClientHttpRequestInterceptor的程序包 程序包 说明 org.springframework.http.client Contains an abstraction over client-side HTTP.org.springframework.http.client.support This package provides generic HTTP support classes, to be used by higher-level classes like RestTemplate.org.springframework.http.client中ClientHttpRequestInterceptor的使用
类型变量类型为ClientHttpRequestInterceptor的org.springframework.http.client中的构造器参数 构造器 说明 InterceptingClientHttpRequestFactory(ClientHttpRequestFactory requestFactory, List<ClientHttpRequestInterceptor> interceptors)
Create a new instance of theInterceptingClientHttpRequestFactory
with the given parameters.org.springframework.http.client.support中ClientHttpRequestInterceptor的使用
实现ClientHttpRequestInterceptor的org.springframework.http.client.support中的类 修饰符和类型 类 说明 class
BasicAuthenticationInterceptor
ClientHttpRequestInterceptor
to apply a given HTTP Basic Authentication username/password pair, unless a customAuthorization
header has already been set.class
BasicAuthorizationInterceptor
已过时。as of 5.1.1, in favor ofBasicAuthenticationInterceptor
which reusesHttpHeaders.setBasicAuth(java.lang.String, java.lang.String)
, sharing its default charset ISO-8859-1 instead of UTF-8 as used here返回变量类型为ClientHttpRequestInterceptor的类型的org.springframework.http.client.support中的方法 修饰符和类型 方法 说明 List<ClientHttpRequestInterceptor>
InterceptingHttpAccessor. getInterceptors()
Get the request interceptors that this accessor uses.类型变量类型为ClientHttpRequestInterceptor的org.springframework.http.client.support中的方法参数 修饰符和类型 方法 说明 void
InterceptingHttpAccessor. setInterceptors(List<ClientHttpRequestInterceptor> interceptors)
Set the request interceptors that this accessor should use.