3 ms·
Well, I think you could definitely stretch it that way, because the Accept header is absolutely intended for situations like this: It lets you specify precisely
by 9dev 5y ago
Well, I think you could definitely stretch it that way, because the Accept header is absolutely intended for situations like this: It lets you specify precisely which content formats you're willing to accept, and in which particular order.
Accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8
No reason why that couldn't read like this instead:
Accept: application/vnd.hash+sha256, application/vnd.hash+sha1;q=0.9, application/vnd.hash+md5;q=0.8
That would indicate to the server that you'd like to receive (preferably) SHA256, with a fallback to SHA1, and another fallback to MD5, if none of the other two is available. If the server isn't able to provide any of those, it returns a "406 Not Acceptable" response.
HTTP covers all of this out of the box, people just tend to overlook the more advanced stuff.