Are HTTP headers case-sensitive?

后端 未结 8 2402
梦如初夏
梦如初夏 2020-11-22 03:03

In a blog post I use the following PHP to set the content-type of a response:

header(\'content-type: application/json; charset=utf-8\');

I

8条回答
  •  天命终不由人
    2020-11-22 03:09

    officially, headers are case insensitive, however, it is common practice to capitalize the first letter of every word.
    but, because it is common practice, certain programs like IE assume the headers are capitalized.
    so while the docs say the are case insensitive, bad programmers have basically changed the docs.

提交回复
热议问题