HTTP 标头(Content-Type,&c.)是否区分大小写? [英] Are HTTP headers (Content-Type, &c.) case-sensitive?

查看:28
本文介绍了HTTP 标头(Content-Type,&c.)是否区分大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许我浏览得太快了,但找不到具体记录.在我的特殊情况下,我想知道Content-Type"标头,但我假设相同的规则将适用于其他标准标头.

Perhaps I'm skimming too fast, but couldn't find this specifically documented. In my particular case, I'm wondering about the "Content-Type" header, but I'm assuming the same rules would apply to other standard headers.

这些是否区分大小写,如果是:是 Content-Type 还是 Content-type?

Are these case sensitive, and if so: Is it Content-Type or Content-type?

有合适的地方引用这些吗?

Is there a proper place to reference these?

推荐答案

不区分大小写.

超文本传输​​协议 -- HTTP/1.1:

4.2 消息头

HTTP 标头字段,其中包括 general-header(第 4.5 节),request-header(第 5.3 节)、response-header(第 6.2 节)和entity-header(第 7.1 节)字段,遵循相同的通用格式在 RFC 822 [9] 的第 3.1 节中给出.每个头域包括名称后跟冒号 (":") 和字段值.字段名称不区分大小写.

HTTP header fields, which include general-header (section 4.5), request-header (section 5.3), response-header (section 6.2), and entity-header (section 7.1) fields, follow the same generic format as that given in Section 3.1 of RFC 822 [9]. Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive.

这篇关于HTTP 标头(Content-Type,&c.)是否区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆