Package top.tangyh.basic.cloud.http
Class RestTemplateHeaderInterceptor
java.lang.Object
top.tangyh.basic.cloud.http.RestTemplateHeaderInterceptor
- All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor
public class RestTemplateHeaderInterceptor
extends Object
implements org.springframework.http.client.ClientHttpRequestInterceptor
通过 RestTemplate 调用时,传递请求头和线程变量
- Author:
- zuihou
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.client.ClientHttpResponseintercept(org.springframework.http.HttpRequest request, byte[] bytes, org.springframework.http.client.ClientHttpRequestExecution execution)
-
Constructor Details
-
RestTemplateHeaderInterceptor
public RestTemplateHeaderInterceptor()
-
-
Method Details
-
intercept
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request, byte[] bytes, org.springframework.http.client.ClientHttpRequestExecution execution) throws IOException - Specified by:
interceptin interfaceorg.springframework.http.client.ClientHttpRequestInterceptor- Throws:
IOException
-