【发布时间】:2018-05-16 00:06:05
【问题描述】:
我正在尝试使用带有 Spring Boot 的 Camel 进行 GET 调用。当我使用以下代码时,我得到 406 代码。但是,如果我尝试使用邮递员到达端点,我会得到 200 响应(json)。请帮忙。
from(RouteUtils.buildSedaEndpointWithConcurrentConsumers("sedaEndpointin", domain.getThreads()))
.routeId("routeiD")
.setProperty("workerId").jsonpath("$.worker_id")
.setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.GET))
.setHeader(Exchange.HTTP_QUERY, simple(String.format("key=%s&barcode=${exchangeProperty.workerId}", apiKey)))
.setHeader(Exchange.HTTP_URI, simple("https://" + endpoint))
.setHeader("Authorization", simple(Auth))
.setHeader("Content-Type", constant("application/json"))
.to("http4://" + Endpoint)
.to("sedaEndpoint");
【问题讨论】:
标签: rest get apache-camel http-status-code-406