Skip to content

Instantly share code, notes, and snippets.

@berinle
Created December 19, 2016 18:31
Show Gist options
  • Select an option

  • Save berinle/91c1e80b13f4d0ce1de67cd02dd20972 to your computer and use it in GitHub Desktop.

Select an option

Save berinle/91c1e80b13f4d0ce1de67cd02dd20972 to your computer and use it in GitHub Desktop.
request interceptor
class AuthInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate template) {
Map<String, Collection<String>> headers = template.request().headers();
Collection<String> authorization = headers.get("Authorization");
if (null != authorization && !authorization.isEmpty()) {
for (String s : authorization) {
template.header("Authorization", s);
}
}
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment