Under the covers I am using Spring MVC 3.0 that provides the Rest infrastructure, Jackson for the Json marshalling and Jaxb for marshalling the XML data.
First of all, here is what I have accomplished: The page that returns a list of presentations and the page that returns a list of speakers, will both return the data in either XML or JSON as well. Bear in mind this is still a fairly rough cut and the data representation may still change quite a bit.
Anyway, these are the exposed endpoints so far:
http://www.devnexus.com/s/presentations
Returns any of the other following 3 data representations depending of the Accept Http header. (However, a defined file extension always wins over the Accept header.)
- http://www.devnexus.com/s/presentations.html
- http://www.devnexus.com/s/presentations.xml
- http://www.devnexus.com/s/presentations.json
Returns any of the other following 3 data representations depending of the Accept Http header. (However, a defined file extension always wins over the Accept header.)
- http://www.devnexus.com/s/speakers.html
- http://www.devnexus.com/s/speakers.xml
- http://www.devnexus.com/s/speakers.json
- application/xml
- application/json
- text/html
As mentioned above, I will blog about the technical details and encountered issues in the next couple of days. Also, if you try to consume the data and run into issues and or have suggestions - ping me and add a comment!
2 comments:
Might be not a good idea to use the Accept header. It turns out I have been running into issues with Webkit based browsers and potentially IE. FF was fine.
Read this article for details:
http://www.gethifi.com/blog/browser-rest-http-accept-headers
Better to set ignoreAcceptHeader=true on my Spring ContentNegotiatingViewResolver.
Configuring my Spring context like in this blog posting does the trick: http://www.rickherrick.com/?q=node/63
Nice work Gunnar, thanks!
Post a Comment