Thoughts, issues and ideas on combining HTML Hypermedia APIs and Adaptive Web Design.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Combining HTML Hypermedia APIs and Adaptive Web Design

Thoughts, issues and ideas on combining HTML Hypermedia APIs and Adaptive Web Design. Possibly, in the future, also code examples. Answers to common objections against using HTML as the media type for your API is found here:

Use two different URLs for web and API

Since you might want to split the solution in the future, more whatever reason, it's good to create such an option right from the start. The simplest way seems to be to have a duplicated DNS entry, pointing to the same IP.


  • strip CSS and script tags for API perspective
  • deal with images (how?). Perhaps client can indicate via the accept header using a prefix/suffix to the media type?

Different flow for humans and machines

My opinion now is it's to much work to separate responses between humans and machines. The "problem" was that the PRG pattern is needed for humans but not for machines. This twitter conversation made me change my mind: So, use the PRG pattern for both humans and machines - a redirect is interpreted as success and the clint can choose to follow the URL in the redirect or not.

Headless browser support and/or scrapers

Here is a longer list:

However, a headless browser doesn't need to be able to have client JavaScript support in able to use the API.

Client library support for HTML

There are several HTML parser for all possible application platforms out there. I think that parsers with CSS3 syntax (or, think jQuery selector). Here are some I've found:

It seems that HTML API support for iOS is lagging behind. You can use libxml2 - good blog post here (found on The idea of using a UIWebview to access an HTML API actually doesn't seem that bad, if you have implemented the optimization


Blog post: (lots of links here) Video of presentation: Slides: