Open vernomcrp opened 11 years ago
The first part of this is now in develop. There is a general accept handler that will give HTML, XML or JSON representations of the Python data structure built into the response object.
This has been improved over the last six months, but it's still not really taken as far as it should be.
I was hoping to get a description of what we're doing here :)
The idea is to try to match the resource types requested by the user agent with the resource types supported by the end point. To start with we'll be looking for JSON, HTML and XML. The initial HTML and XML will be pretty ugly, but we should in fairly short order be able to support template based rendering for both of these using Django's built in templating features. To start with these will only be global options.
A further refinement will allow individual operations to return a set of content types they can support so then you'd be able to write an operation that might return some JSON data when requested using
application/json
, or return a graph when requested asimage/png
.