-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Francisco Lozano opened SPR-12538 and commented
It would be really useful if AsyncRestTemplate was capable of handling some async-friendly variant of ClientHttpRequestInterceptor's.
I understand the same interceptors are not possible, because the current interface assumes sync behaviour:
{CODE}
ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution)
throws IOException;
{CODE}
But it would be very useful to be able to hook and alter the requests before they are executed. Something like:
{CODE}
HttpRequest intercept(HttpRequest request)
{CODE}
would probably be enough, in order to be able to easily add some headers in a centralized way. The actual execution would be done outside of the scope of the async interceptor - just being able to modify/replace the request would be very useful by itself.
Affects: 4.1.3
Issue Links:
- Buffered AsyncClientHttpResponses [SPR-13657] #17581 Buffered AsyncClientHttpResponses
Referenced from: commits 63958ac, 258cc7b, 12969f6
6 votes, 7 watchers