我看到这个:
https://vertx.io/docs/kdoc/vertx/io.vertx.rxjava.core.http/-http-server-response/set-chunked.html
vertx.createHttpServer()
.requestHandler(req -> {
if (req.method() == HttpMethod.GET) {
req.response().setChunked(true);
}
})
我认为默认情况下分块是正确的,但我在文档中找不到默认值。有谁知道默认值是多少?
最佳答案
setChunked
将 transfer-encoding
header 设置为 chunked
。
当您使用 write
方法向客户端发送一些内容时,Vert.x 会验证 transfer-encoding
或 content-length
header 已设置。
关于java - 分块字段的默认值 - (setChunked),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54385330/