WebClient vs RestTemplate

后端 未结 4 1710
青春惊慌失措
青春惊慌失措 2021-01-30 10:45

As per spring 5:

WebClient is an interface representing the main entry point for performing web requests.

It has been created as a part of the Spring

4条回答
  •  Happy的楠姐
    2021-01-30 10:59

    According to the Java Doc the RestTemplate will be in maintenance mode. Spring team advise to use the WebClient if possible:

    NOTE: As of 5.0, the non-blocking, reactive org.springframework.web.reactive.client.WebClient offers a modern alternative to the RestTemplate with efficient support for both sync and async, as well as streaming scenarios. The RestTemplate will be deprecated in a future version and will not have major new features added going forward.

提交回复
热议问题