Class HttpHeaderInterceptor
java.lang.Object
org.springframework.boot.devtools.remote.client.HttpHeaderInterceptor
- All Implemented Interfaces:
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
- Author:
- Rob Winch
-
Constructor Summary
ConstructorDescriptionHttpHeaderInterceptor
(String name, String value) Creates a newHttpHeaderInterceptor
instance. -
Method Summary
Modifier and TypeMethodDescriptionintercept
(HttpRequest request, byte[] body, ClientHttpRequestExecution execution)
-
Constructor Details
-
HttpHeaderInterceptor
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 Details
-
intercept
public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException - Specified by:
intercept
in interfaceClientHttpRequestInterceptor
- Throws:
IOException
-