HTTP Methods (5)

HTTP Headers (1)

Miscellaneous (3)

Resources (4)

Basics (5)

Mediatypes (1)

如果一个 HTTP ACCEPT 头不合规,返回 406。如果一个 Accept-Language 头不合规,响应什么状态码比较合适?

答案

你应该返回 406. RFC 2616 10.4.7 提到 "accept headers" 是复数。它建议所有 Accept-* 头不合规时,应该返回一个 406 响应。

另请参见

Copyright 2012 Joshua Thijssen and others. Like to contribute? Add your recipe to our github repository.
Looking for Puppet recipies? Try the Puppet CookBook.
Fork me on GitHub