Class HttpHeaderInterceptor
- java.lang.Object
- org.springframework.boot.devtools.remote.client.HttpHeaderInterceptor
- All Implemented Interfaces:
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.- Since:
- 1.3.0
Constructor Summary
Constructors Constructor Description HttpHeaderInterceptor(String name, String value)
Creates a newHttpHeaderInterceptor
instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.client.ClientHttpResponse
intercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution)
Constructor Detail
HttpHeaderInterceptor
public HttpHeaderInterceptor(String name, String value)
Creates a newHttpHeaderInterceptor
instance.- Parameters:
name
- the header name to populate. Cannot be null or empty.value
- the header value to populate. Cannot be null or empty.
Method Detail
intercept
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution) throws IOException
- Specified by:
intercept
in interfaceorg.springframework.http.client.ClientHttpRequestInterceptor
- Throws:
IOException