public interface RequestInterceptor
RequestInterceptors
may be configured for purposes
such as adding headers to all requests. No guarantees are give with regards
to the order that interceptors are applied. Once interceptors are applied,
Target.apply(RequestTemplate)
is called to create the immutable http
request sent via Client.execute(Request, feign.Request.Options)
.
public void apply(RequestTemplate input) { input.replaceHeader("X-Auth", currentToken); }
RequestInterceptors
are configured via Feign.Builder.requestInterceptors
.
/path/{foo}/bar
in your implementation of apply(RequestTemplate)
.
resolved
. This is to ensure
that you can implement signatures are interceptors.
RequestInterceptor.intercept()
,
except that the implementation can read, remove, or otherwise mutate any
part of the request template.Modifier and Type | Method and Description |
---|---|
void |
apply(RequestTemplate template)
Called for every request.
|
void apply(RequestTemplate template)
RequestTemplate
.