[whatwg] [rest-discuss] HTML5 and RESTful HTTP in browsers
Hallvord R M Steen
hallvors at gmail.com
Mon Nov 17 12:48:06 PST 2008
> as an example:
> <a href="http://example.com/report">html report</a>
> <a href="http://example.com/report" Accept="application/pdf">pdf report</a>
> <a href="http://example.com/report" Accept="application/rss+xml">xml report</a>
Sorry, both as an author and as a user I'd prefer this:
<a href="http://example.com/report">html report</a>
<a href="http://example.com/report.pdf">pdf report</a>
<a href="http://example.com/report.xhtml">xml report</a>
- Keep It Simple. For me as an author it's less typing, and for me as
a computer-literate end user it's clear whether a link is going to
make me wait for Acrobat loading or open directly - even if the link
is taken out of the HTML context.
On the other hand, I'd sort of like
<a href="http://example.com/report" AcceptLanguage="no">Norwegian</a>
<a href="http://example.com/report" AcceptLanguage="en">English</a>
As the main problem with using content-negotiation for language right
now is that you need to hard-link to actual files (i.e. file.en.html)
to give users a way to "override" the negotiation on the fly. (No,
nobody will reconfigure their browser to use your site and everyone
must be given a choice of language even if they can't control the
settings of the browser they happen to use.) It's not good enough
though, since one would like the language choice to "stick"
automatically - you still need to fall back to cookies and a custom
script for handling language choice or "no suitable version" errors.
Content negotiation is a lot nicer in theory than in practise..
FWIW, some browsers (at least Firefox - I'm lobbying for it in Opera)
send context-sensitive Accept: headers already, so if you put <img
src="/something"> in your HTML the browser will send only image/*
types in Accept when requesting /something.
Hallvord R. M. Steen
More information about the whatwg