httpcontent-negotiationmedia-typehttp-accept-header

Which media type should be chosen from HTTP Accept header when they have the same specifity, quality and level?


As you know you can add multiple media types to the HTTP Accept header. When it comes to the question "What type should the server return?" most explanations and the spec as well seem to only explain the algorithm to select the "preferred" media type based on the specifity, quality and level of the media type.

But what should be done when they are all the same? Say I have

Is the order important? I found a blog post which states that, but couldn't find a source nor information about it in the spec.

Or is this undefined behaviour and it is up to the server to decide (e.g. always return the newest version) or return "300 Multiple Choice" (rarely seen in the wild) or something else.


Solution

  • The blog post is wrong; the ordering is not relevant. it's up to the server to choose, or, as you said, return 300.