请求不随订阅一起发送

时间:2019-10-14 17:54:24

标签: java spring rest spring-boot spring-webflux

我正在尝试运行以下代码:

Mono<String> personMono = Mono.just("wfw");

        WebClient client = WebClient.create("https://webhook.site");

        Mono<Void> result = client.post()
                .uri("/a6ad3a35-61c6-4bfc-8d8c-7e5a3e2462aa")
                .contentType(MediaType.APPLICATION_JSON)
                .body(personMono, String.class)
                .exchange()
                .flatMap(response -> response.bodyToMono(Void.class));

        result.subscribe();

但请求未发送。您知道我需要添加什么才能发出POST请求吗?我找不到我想要的东西吗?

0 个答案:

没有答案