guava使用技巧 `
public RequestInterceptor headerInterceptor() {
return new RequestInterceptor(){
public void apply(RequestTemplate template) {
List<String> authorizationList = Lists.newArrayList("Bearer "+tokenId);
List<String> contentTypeList = Lists.newArrayList("application/json");
contentTypeList.add("application/json");
Map<String, Collection<String>> headers =ImmutableMap.of("Authorization", authorizationList,"Content-Type", contentTypeList);
template.headers(headers);
}
};
}
`