Are HTTP extension permissions exclusive?

I am reading HTTP Header Field Definitions for proper header analysis, and I come across an accept-extension field definition. They are part of the priority of the receiving headers, which gives the following order:

text/html;level=1;param=other // Less specific : text/html;level=1 // Less specific: text/html // Even less specific text/* 

I'm not sure what should happen if the client requests text / html; level = 1, but I only have a content provider for text / html. Send text / html content or 406 error (invalid)?

+4
source share
1 answer

In your example, you will send back 406. If they can also accept the base text / html, they should send this:

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

Note that order does not matter, and the most specific always takes precedence.

+1
source

Source: https://habr.com/ru/post/1335446/


All Articles