【发布时间】:2020-12-20 18:09:14
【问题描述】:
如何重写这段代码以使用retrieve()方法?
suspend fun getEntity(): ResponseEntity<EntityDto> {
return restClient
.get()
.uri { ... }
.accept(MediaType.APPLICATION_JSON)
.awaitExchange()
.awaitEntity()
}
当我使用retrieve() 时,我收到以下错误:
org.springframework.web.reactive.function.UnsupportedMediaTypeException: 内容类型 'application/json;charset=UTF-8' 不支持 bodyType=org.springframework.http.ResponseEntity
【问题讨论】:
标签: spring-boot rest kotlin webclient