我有一个 https 请求,它的 uri 以大写字母开头。我已经在邮递员中对其进行了测试,并得到了响应;但是在我的vertx (io.vertx.core) 代码中,我无法获得所需的响应响应。目标服务器似乎拒绝了我。看来我想要的 uri 会自动变为小写。不幸的是,服务器不接受更改的模式。
所需的 uri:/Internalservice
https://example.com/Internalservice
我使用这个 webClient:io.vertx.ext.web.client;
这是我的方法:
public CompletionStage<HttpResponse> post(String host, int port, String uri, MultiMap headers, JsonObject body) {
return client.post(port, host, uri)
.putHeaders(headers)
.timeout(requestTimeout.toMillis())
.sendJsonObject(body)
.toCompletionStage()
.thenApply(response -> new HttpResponse(response.statusCode(), response.body() != null ? response.body().getBytes() : new byte[]{}));
}
我必须做些什么来处理这个区分大小写的uri?