[whatwg] [rest-discuss] HTML5 and RESTful HTTP in browsers

mike at mykanjo.co.uk mike at mykanjo.co.uk
Mon Nov 17 03:29:44 PST 2008


Just to let everyone know that I posted the following to rest-discuss this morning, any thoughts? :


I've read that HTML5 will be providing markup for the PUT and DELETE methods. This is definitely good news - but I considered something else recently that, from what I can gather, is not in the current spec for HTML5; markup for specifying appropriate Accept headers for requests.

My initial idea is that hypermedia tags (such as <a> and <img>) could contain an optional Accept attribute, for indicating the appropriate content-type for the request indicated.

I brought this up recently in #whatwg on freenode, and I was informed that this is not currently being considered since the equivalent can be achieved by a URL parameter such as '?type=application/xml'. Many would not Accept (pun intended - sorry) that this method was significantly different, some even went as far as to suggest (disturbingly) that serving multiple content-types from the same URI is undesirable!

To my mind, the best situation would be to have both options available for developers. Although, I assume that specifying content-type in a URI is violating RESTful principals; theoretically at least.

One argument that can be made for providing the option for both methods is browser bookmarking - can anyone tell me how browsers store bookmarks; do they store the entire request complete with headers? If this is not the case, the only feasible way to provision typed bookmarking is to specify the type in the URL.

Does anyone else agree that an Accept attribute would be a useful tool for making browser interaction more RESTful? Is it worth persuing this issue with the HTML5 working group?

Regards,
Mike



More information about the whatwg mailing list