spring-webclient

Spring boot Webclient's retrieve vs exchange

核能气质少年 提交于 2020-12-30 05:09:01
问题 I have started using WebClient in my Spring boot project recently. Can somebody throw some light on the differences/usages between exchange and retrieve method in WebClient . I undertand that exchange returns Mono<ClientResponse> and retrieve returns ResponseSpec , I just want to know when/why I should use each one of them. Much Thanks. 回答1: According to spring Webclient api documentation the difference between the two is that exchange retrieve in addition to the body other http response

Spring boot Webclient's retrieve vs exchange

こ雲淡風輕ζ 提交于 2020-12-30 05:08:38
问题 I have started using WebClient in my Spring boot project recently. Can somebody throw some light on the differences/usages between exchange and retrieve method in WebClient . I undertand that exchange returns Mono<ClientResponse> and retrieve returns ResponseSpec , I just want to know when/why I should use each one of them. Much Thanks. 回答1: According to spring Webclient api documentation the difference between the two is that exchange retrieve in addition to the body other http response