public class HttpHeaderInterceptor extends Object implements 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.Constructor and Description |
---|
HttpHeaderInterceptor(String name,
String value)
Creates a new
HttpHeaderInterceptor instance. |
Modifier and Type | Method and Description |
---|---|
ClientHttpResponse |
intercept(HttpRequest request,
byte[] body,
ClientHttpRequestExecution execution) |
public HttpHeaderInterceptor(String name, String value)
HttpHeaderInterceptor
instance.name
- the header name to populate. Cannot be null or empty.value
- the header value to populate. Cannot be null or empty.public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException
intercept
in interface ClientHttpRequestInterceptor
IOException