首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >maxHttpHeaderSize和content-length的区别

maxHttpHeaderSize和content-length的区别
EN

Stack Overflow用户
提问于 2015-07-08 19:03:42
回答 1查看 3.6K关注 0票数 2

Apache tomcat server.xml中的maxHttpHeaderSize和HttpServletRequest/HttpServletResponse中的content-length有什么不同。

代码语言:javascript
复制
    maxHttpHeaderSize  -  The maximum size of the request and response HTTP header, specified in bytes. If not specified, this attribute is set to 4096 (4 KB).

content-Length  -The Content-Length entity-header field indicates the size of the entity-body, in decimal number of OCTETs, sent to the recipient or, in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET. 

这两个参数之间有什么关系吗?

EN

回答 1

Stack Overflow用户

发布于 2015-07-08 20:08:24

两者之间没有直接联系。

content-length是一个HTTP header field,它以八位字节(8位字节)为单位指定请求主体的长度。它是所有HTTP请求的通用字段,与Apache Tomcat没有特定的连接。

maxHttpHeaderSize字段是Apache Tomcat配置文件中的一个配置字段-它限制服务器发送/接收的任何HTTP头的大小(我认为是出于安全/或网络优化的原因)。

HttpServletRequest/HttpServletResponse是用于为HTTP提供请求信息的接口:例如,您可以使用它来获取发送/接收的HTTP请求的CONTENT_LENGTH信息。

希望现在区别已经很明显了。如果您想更好地理解HTTP协议,请从Hypertext_Transfer_Protocol开始

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31290787

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档