【发布时间】:2011-08-14 03:00:13
【问题描述】:
我想知道我是否可以返回响应头
Content-Type: application/json text/json
这不合法吗?
HTTP 协议规定 Content-Type 应该是 mediaType 并且 mediaType 定义如下:
media-type = type "/" subtype *( ";" parameter )
type = token
subtype = token
但是我无法解释这意味着什么,有人可以启发我吗?
谢谢!
【问题讨论】:
-
请注意,
Content-Type与任何其他标题一样,可能出现两次或更多次。 -
@Stephan 我不这么认为:tools.ietf.org/html/rfc7230#section-3.2.2 的转义子句似乎都不适用于 Content-Type。
标签: http http-headers