Entries published on November 29, 2008
Another take on content negotiation
Today my co-worker Daniel posted a class which performs content negotiation for Django views, allowing you to write a single view which returns any of several types of responses (e.g., HTML, JSON, XML) according to the incoming HTTP
Accept header. While it’s certainly cool, he notes a couple of issues with it (including the redundancy it introduces in URL configuration).
So let’s see if we can’t come up with a way to work around this.
It seems that the best way to approach this is to …