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?
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,...
Hi ... Why? I mean, forgetting the HTML5 WG etc., why would you want to do this ? IMHO, the content-type that the client wants should be the decision of the...
But if the server wants to link to a particular content-type only, then isn't that a different resource? Cos tomorrow, the other server could stop serving that...
On Mon, 17 Nov 2008 19:17:53 +0530 ... The server can't know the preferences or capabilities of clients from one request to the next. If a link to a...
Eric J. Bowman
eric@...
Nov 18, 2008 8:16 am
... Exactly - my argument is that HTML5 should provide at least the option for developers to chose whether or not to make use of HTTP conneg in their web...
Mike, ... In your model, the server would be returning HTML like <a href="...." preferAccepts="some media types"/> which then influences the Accept-* headers...
... Right - that is unavoidable, in a browser has ways to handle content types that are not appropriate though. It's no different from conneg in the URI - the...
... I agree. But I think this may introduce some peculiarities for web developers. Consider some cases: a. Bookmarked URIs: Need to use agent-driven...
... If a bookmark stored the URI and the Accept headers, would that not be sufficient? Is a bookmark not just a stored state? Are request headers outside of...
... Not today. ... No. You can't tie Accept* headers to security. ... This is because there need not be a standard way to do that. When you are using...
"But if the server wants to link to a particular content-type only, then isn't that a different resource? Cos tomorrow, the other server could stop serving...
... Well actually I do believe that they are different resources. Don't get into the "What is below", every server has a possibly infinite number of URLs .....
... Not to distract from the main point, but a resource can have any number or URIs. However, a URI can at most represent one resource. - Steve ... Steve G....
Why should it be used just as a 'fallback'? I can't seedevelopers moving to implement multiple representations at single URIsif the browsers (and HTML) can't...
mike: I think I'm missing a key point in regards to using "type" and IMG tags. Getting your response to a concrete example will help me: I include the...
mca, What happens if I want to serve a png *and* an animated gif representation at /images/logo? I want to serve your UA the animated gif.. but it will only...
... Not sure how this can be useful, since the UA and not the server (through hypermedia) needs to do the negotiation. Let's say, when you create a link <a...
"Not sure how this can be useful, since the UA and not the server (through hypermedia) needs to do the negotiation. Let's say, when you create a link <a...
... There is no experiment that could determine if it's the same resource with different representations or different resources, unless the server told you so....
On Mon, 17 Nov 2008 12:05:54 +0100 ... Not at all. Horribly bad practice, though... A URI identifies a resource, there's nothing theoretically wrong with two...
Eric J. Bowman
eric@...
Nov 18, 2008 7:59 am
... If the solution uses JavaScript for Accept headers and PUT/DELETE requests, is that browser support or JavaScript virtual machine support? Maybe someone...
On Tue, 18 Nov 2008 12:22:02 +0000 ... I don't know what a JavaScript virtual machine is. Since scripting makes use of the capabilities a browser already has,...
Eric J. Bowman
eric@...
Nov 18, 2008 3:13 pm
... There is no practical reason to modify User-Agent in markup, the UA is probably the best indicator of this header, so I don't see how that is relevant...
On Tue, 18 Nov 2008 17:38:08 +0000 ... Take your time, conneg is a toughie, re-learning it in the context of REST won't happen overnight... but, bluntly,...
Eric J. Bowman
eric@...
Nov 20, 2008 7:02 am
... Aside from being rude, you've missed the point. Bill...