3 ms·
> Also, why change the content type when one could just add some query string parameters? For the same reason you use HTTP verbs. It conveys more information w
by sergiosgc 11y ago
> Also, why change the content type when one could just add some query string parameters?
For the same reason you use HTTP verbs. It conveys more information within the standard. Software in the middle may act upon it. A cache is a perfect example. Imagine the cache sees a request accepting json or xml. The server chooses to return json. A second request accepts only json. The cache knows, from the standard, that the first response is valid for the second request.
Not that you can't configure something like Varnish to reproduce this behavior with query params, but with the standard oriented approach you get the correct caching behavior out of the box.