根据 HTTP1.1 spec,以下的Accept标头 Accept: text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c 被解释为 text/html and text/x-c are the preferred media types, but if they do not exist, then send the text/x-dvi entity, and if
Accept: text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c
被解释为
text/html and text/x-c are the preferred media types, but if they do not exist, then send the text/x-dvi entity, and if that does not exist, send the text/plain entity
让我们将标题更改为:
Accept: text/html, text/x-c
如果这两个都不被接受,会返回什么?例如让我假装我只支持application / json
也许你应该回应406不可接受.这就是我读 this的方式.或415不支持的媒体类型?
我会选择406,因为在这种情况下并根据规格,回复应该包括一系列备选方案.虽然我不清楚该列表应该如何.