cookbook:javacodepieces
这是本文档旧的修订版!
AtomicReference<String> body = new AtomicReference<>();
client.call(
request,
response -> {
try {
body.set(new String(response.body().readAllBytes(), Charset.defaultCharset()));
} catch (IOException ex) {
throw new RuntimeException(ex);
}
},
new RequestOptions()
.setUrl("https://yaocheng.cn/cat/add")
.setTimeout(Duration.of(1L, ChronoUnit.SECONDS)));
cookbook/javacodepieces.1634894189.txt.gz · 最后更改: 2021/10/22 17:16 由 plough