HTTP 1.1 - Can a client request that transfers not be “chunked”?

前端 未结 2 1527
无人及你
无人及你 2021-01-04 11:04

Is it possible for a HTTP 1.1 client to set a header value that indicates the responses to requests should not be chunked? Or is the only way to prevent this, is to send a H

相关标签:
2条回答
  • 2021-01-04 11:27

    To get Content-Length in bytes instead of chunked inside the response with HTTP 1.1, you have to set Content-Length header and its size (long or int) based on the file you are expecting inside the response. long will be good so it can take care small as well as big file size. response will be HttpServletResponse. response.addHeader(Content-Length, Long.toString()); Thanks,

    0 讨论(0)
  • 2021-01-04 11:34

    In HTTP (starting with HTTP/1.1), recipients MUST support chunked encoding. See http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p1-messaging-26.html#rfc.section.4.1.p.4.

    0 讨论(0)
提交回复
热议问题