You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This way of ReactiveHttpRequestInterceptor adding in the request header data, based on jdk17 can give a demo, to the problem of implementation of this way to seek the aid of bosses. Thank you very much.
The text was updated successfully, but these errors were encountered:
@ConfigurationpublicclassFeignConfigimplementsReactiveHttpRequestInterceptor {
/** * Applies this function to the given argument. * * @param reactiveHttpRequest the function argument * @return the function result */@OverridepublicMono<ReactiveHttpRequest> apply(ReactiveHttpRequestreactiveHttpRequest) {
returnMono.deferContextual(context -> {
// 从 Reactor Context 中获取 tokenStringtoken = context.get(HttpHeaders.AUTHORIZATION);
// 将 token 放入请求头asserttoken != null;
reactiveHttpRequest.headers().put(HttpHeaders.AUTHORIZATION, List.of(token));
returnMono.just(reactiveHttpRequest);
});
}
}
This way of ReactiveHttpRequestInterceptor adding in the request header data, based on jdk17 can give a demo, to the problem of implementation of this way to seek the aid of bosses. Thank you very much.
The text was updated successfully, but these errors were encountered: