playframework - Play WSClient url 无法访问
问题描述
我在我的游戏框架中使用 WS java 客户端。但我收到以下回复。我的来源是
WSRequest request = ws.url("http://localhost:9000/office");
CompletionStage<String> response = request.get().thenApply(x -> x.getBody());
String s = response.toCompletableFuture().get();
System.out.println(s);
输出如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Error response</title> </head> <body> <h1>Error response</h1> <p>Error code: 400</p> <p>Message: Bad Request.</p> <p>Error code explanation: 400 - Bad request syntax or unsupported method.</p> </body> </html>
我已将所有预先启用的过滤器禁用为“play.filters.enabled = []”。我真的很欣赏你的建议。
解决方案
推荐阅读
- amazon-web-services - 使用嵌入式度量格式记录错误
- amazon-web-services - AWS cloudformation - 获取子字符串
- javascript - 我在卡片的两面都有包含图像的列表项,我的目标是随机选择列表项并将卡片自动翻转到无限
- django - 在 Django 中过滤两个特定时间之间的帖子
- python - 稀疏矩阵 Cholesky 分解的复杂性
- python - 发布到我的烧瓶服务器的奇怪请求
- azure - 如何在 azure devops 中查看我的 Git 存储库中所做的所有常规代码更新?
- python-3.x - Python语音识别和deepspeech
- python - 连接手机时出现 TcpTimeoutException
- android - 如何在jetpack compose中实现图像的缩放和平移