public class HeaderRequestInterceptor
extends java.lang.Object
implements org.springframework.http.client.ClientHttpRequestInterceptor
The header request interceptors can be applied to a RestTemplate
and
will add the header's at runtime.
Constructor and Description |
---|
HeaderRequestInterceptor(java.lang.String name,
java.lang.String value)
Class Constructor
|
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 HeaderRequestInterceptor(java.lang.String name, java.lang.String value)
name
- Name of the header key to add.value
- Value of the header key to add.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.ClientHttpRequestInterceptor
java.io.IOException