Package com.gooddata.sdk.service
Class HeaderSettingRequestInterceptor
- java.lang.Object
-
- com.gooddata.sdk.service.HeaderSettingRequestInterceptor
-
- All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor
public class HeaderSettingRequestInterceptor extends java.lang.Object implements org.springframework.http.client.ClientHttpRequestInterceptorIntercepts client-side HTTP requests and sets HTTP headers passed to constructor of this class. Implementations of this interface can be registered with the RestTemplate, as to modify the outgoing ClientHttpRequest and/or the incoming ClientHttpResponse.
-
-
Constructor Summary
Constructors Constructor Description HeaderSettingRequestInterceptor(java.util.Map<java.lang.String,java.lang.String> headers)Construct interceptor for setting given HTTP headers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.client.ClientHttpResponseintercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution)Intercept the given request, set headers passed to constructor, and return a response.
-
-
-
Method Detail
-
intercept
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution) throws java.io.IOExceptionIntercept the given request, set headers passed to constructor, and return a response. The givenClientHttpRequestExecutionallows the interceptor to pass on the request and response to the next entity in the chain.- Specified by:
interceptin interfaceorg.springframework.http.client.ClientHttpRequestInterceptor- Parameters:
request- the request, containing method, URI, and headersbody- the body of the requestexecution- the request execution- Returns:
- the response
- Throws:
java.io.IOException- in case of I/O errors
-
-