Search the web
Sign In
New User? Sign Up
rest-discuss · REST Discussion Mailing List
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
HTML5 and RESTful HTTP in browsers   Message List  
Reply | Forward Message #11508 of 14243 |
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



Mon Nov 17, 2008 11:05 am

pleb1985
Offline Offline
Send Email Send Email

Forward
Message #11508 of 14243 |
Expand Messages Author Sort by Date

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,...
mike@...
pleb1985
Offline Send Email
Nov 17, 2008
1:12 pm

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...
dev
bertie_woost...
Offline Send Email
Nov 17, 2008
1:29 pm

I think that the assumption was that the references could be to resources on different servers. Hypermedia and so on. -Justin...
Justin Sheehy
macsithigh_f...
Offline Send Email
Nov 17, 2008
1:44 pm

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...
dev
bertie_woost...
Offline Send Email
Nov 17, 2008
1:47 pm

If i am reading the spec correctly, HTML4 defines the "type" attribute for the anchor tag (A) and the link tag (LINK) ...
mike amundsen
mamund
Offline Send Email
Nov 17, 2008
2:02 pm

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@...
Send Email
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
pleb1985
Offline Send Email
Nov 18, 2008
10:02 am

Mike, ... In your model, the server would be returning HTML like <a href="...." preferAccepts="some media types"/> which then influences the Accept-* headers...
Subbu Allamaraju
sallamar
Offline Send Email
Nov 18, 2008
3:22 pm

/echo Subbu...
Alan Dean
alan_james_dean
Offline Send Email
Nov 18, 2008
3:31 pm

... 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...
Mike
pleb1985
Offline Send Email
Nov 18, 2008
3:31 pm

... I agree. But I think this may introduce some peculiarities for web developers. Consider some cases: a. Bookmarked URIs: Need to use agent-driven...
Subbu Allamaraju
sallamar
Offline Send Email
Nov 18, 2008
5:12 pm

... 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...
Mike
pleb1985
Offline Send Email
Nov 19, 2008
10:11 am

... 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...
Subbu Allamaraju
sallamar
Offline Send Email
Nov 20, 2008
10:32 pm

"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...
mike@...
pleb1985
Offline Send Email
Nov 17, 2008
3:17 pm

... 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 .....
dev
bertie_woost...
Offline Send Email
Nov 17, 2008
3:30 pm

... 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....
Steve Bjorg
steve_bjorg
Offline Send Email
Nov 17, 2008
3:42 pm

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@...
pleb1985
Offline Send Email
Nov 17, 2008
3:19 pm

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...
mike amundsen
mamund
Offline Send Email
Nov 17, 2008
3:25 pm

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...
mike@...
pleb1985
Offline Send Email
Nov 17, 2008
3:41 pm

... 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...
Subbu Allamaraju
sallamar
Offline Send Email
Nov 17, 2008
3:51 pm

"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...
mike@...
pleb1985
Offline Send Email
Nov 17, 2008
4:16 pm

... I was implying that treating representations as resources was not RESTful....
mike@...
pleb1985
Offline Send Email
Nov 17, 2008
4:18 pm

... 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....
Steve Bjorg
steve_bjorg
Offline Send Email
Nov 17, 2008
7:09 pm

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@...
Send Email
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...
Mike
pleb1985
Offline Send Email
Nov 18, 2008
12:16 pm

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@...
Send Email
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...
Mike
pleb1985
Offline Send Email
Nov 18, 2008
5:32 pm

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@...
Send Email
Nov 20, 2008
7:02 am

... Aside from being rude, you've missed the point. Bill...
Bill de hOra
bdehora
Offline Send Email
Nov 23, 2008
5:33 pm
First  | < Prev  |  Last 
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help