Add request header request Feign

If you call another service when the front-end should pass over the token with the past, which would be to write a RequestInterceptor implementation class, in which apply the method, the acquisition request based on the current thread, remove the inside of the token, placed parameter in RequestTemplate .

Its principle, according to feign source said before, in the SynchronousMethodHandler invoke ---> executeAndDecode ---> Request request = targetRequest (template) in

Guess you like

Origin www.cnblogs.com/chuliang/p/11918717.html