开发者

Are HTTP accept extensions exclusive?

I am reading the HTTP Header Field Definitions in order to parse accept headers properly and I am stumbling over the accept-extension field definition. They are part of indicating the accept headers precedence, which would give the following order:

text/html;level=1;param=other
// Less specific :
text/html;level=1
// Less specific:
text/html
// 开发者_如何学GoEven less specific
text/*

I am not sure what should happen, if a client requests text/html;level=1 but I only have a content provider for text/html. Do I send the text/html content or a 406 (Not Acceptable) error?


In your example, you would send back a 406. If they can also accept a basic text/html, they should send this:

Accept: text/html, text/html;level=1 

Note that order doesn't matter, and the most specific always takes precedence.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜