public class HttpHeaderInterceptor
extends java.lang.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.| Constructor and Description |
|---|
HttpHeaderInterceptor(java.lang.String name,
java.lang.String value)
Creates a new
HttpHeaderInterceptor instance. |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.client.ClientHttpResponse |
intercept(org.springframework.http.HttpRequest request,
byte[] body,
org.springframework.http.client.ClientHttpRequestExecution execution) |
public HttpHeaderInterceptor(java.lang.String name,
java.lang.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 org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request,
byte[] body,
org.springframework.http.client.ClientHttpRequestExecution execution)
throws java.io.IOException
intercept in interface org.springframework.http.client.ClientHttpRequestInterceptorjava.io.IOException