【发布时间】:2021-09-03 11:06:03
【问题描述】:
我正在尝试使用 webflux 将 json 字符串发送到 put 端点。
例如假设我要达到的终点是http://etc:99999/put/here,我的代码如下所示:
@Service
public class someService {
private final WebClient webClient;
public someService(WebClient.Builder webClientBuilder) {
this.webClient = webClientBuilder.baseUrl("http://etc:9999999/").build();
}
public Mono<Void> sendPut(String someMessage) {
return webClient.put()
.uri("put/here")
.contentType(MediaType.APPLICATION_JSON)
.bodyValue(someMessage)
.retrieve();
}
}
但是,这似乎根本没有达到终点。我做错了什么?
【问题讨论】:
标签: json spring-boot http spring-webflux put