首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >WebClientResponseException$NotFound: 404未找到

WebClientResponseException$NotFound: 404未找到
EN

Stack Overflow用户
提问于 2021-11-03 14:48:02
回答 1查看 815关注 0票数 0

我试图调用另一个API,它给了我WebClientResponseException

代码语言:javascript
运行
复制
2021-11-03 19:54:55.762 [5a2a9625f3c7ff19/5a2a9625f3c7ff19] ERROR
        {FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=green, DEBUG=green bold, TRACE=blue} 23556 [ctor-http-nio-4] r.u.Loggers$Slf4JLogger                 
        {cyan} : onError(org.springframework.web.reactive.function.client.WebClientResponseException$NotFound: 404 Not Found from POST http://localhost:8082/v1/persons/getAllIds)
2021-11-03 19:54:55.788 [5a2a9625f3c7ff19/5a2a9625f3c7ff19] ERROR
        {FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=green, DEBUG=green bold, TRACE=blue} 23556 [ctor-http-nio-4] r.u.Loggers$Slf4JLogger                 
        {cyan} : 

org.springframework.web.reactive.function.client.WebClientResponseException$NotFound: 404 Not Found from POST http://localhost:8082/v1/persons/getAllIds
    at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:185)
    Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
    |_ checkpoint ⇢ 404 from POST http://localhost:8082/v1/persons/getAllIds [DefaultWebClient]
Stack trace:
        at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:185)
        at org.springframework.web.reactive.function.client.DefaultClientResponse.lambda$createException$1(DefaultClientResponse.java:209)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:100)
        at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:96)
        at reactor.core.publisher.FluxDefaultIfEmpty$DefaultIfEmptySubscriber.onNext(FluxDefaultIfEmpty.java:92)
代码语言:javascript
运行
复制
@Override
public Flux<Person> getByIds(List<String> ids) {
    log.info("getIds :  {}",ids);
    return webClient.post()
            .uri(uriBuilder -> uriBuilder.path(config.getIdURL()).build())
            .contentType(MediaType.APPLICATION_JSON)
            .body(Mono.just(ids), List.class)
            .header(geConstant.X_APP_ID_KEY, geConstant.X_APP_ID_VALUE)
            .header(geConstant.X_API_KEY_KEY, geConstant.X_API_KEY_VALUE)
            .retrieve()
            .bodyToFlux(Person.class)
            .log("Find ids : " + ids)
            .retryBackoff(3, Duration.ofSeconds(30));
}
EN

回答 1

Stack Overflow用户

发布于 2022-11-10 15:55:51

我建议您在(POST) http://localhost:8082/v1/persons/getAllIds上找到该URL,以确保您已经运行了该端点,并使用Postman进行了访问。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69826930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档