类 HttpHeaderInterceptor
- java.lang.Object
- org.springframework.boot.devtools.remote.client.HttpHeaderInterceptor
- 所有已实现的接口:
org.springframework.http.client.ClientHttpRequestInterceptor
public class HttpHeaderInterceptor extends Object implements org.springframework.http.client.ClientHttpRequestInterceptor
ClientHttpRequestInterceptor
to populate arbitrary HTTP headers with a value. For example, it might be used to provide an X-AUTH-TOKEN and value for security purposes.- 从以下版本开始:
- 1.3.0
构造器概要
构造器 构造器 说明 HttpHeaderInterceptor(String name, String value)
Creates a newHttpHeaderInterceptor
instance.
构造器详细资料
HttpHeaderInterceptor
public HttpHeaderInterceptor(String name, String value)
Creates a newHttpHeaderInterceptor
instance.- 参数:
name
- the header name to populate. Cannot be null or empty.value
- the header value to populate. Cannot be null or empty.
方法详细资料
intercept
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution) throws IOException
- 指定者:
intercept
在接口中org.springframework.http.client.ClientHttpRequestInterceptor
- 抛出:
IOException