.. _html_as_media_type:
============================================================
2012-07-10 **Using HTML as the Media Type for your API**
============================================================
- https://twitter.com/jon_moore
- https://blog.jonm.dev/posts/using-html-as-the-media-type-for-your-api/
- :ref:`related_frow`
There is an ongoing (and interesting) `discussion `_
on the API-craft mailing list revolving around designing new media types
for enabling hypermedia APIs primarily for programmatic consumption.
As some folks may know, I like to use HTML as the media type for my
hypermedia APIs. `Steven Willmott opined `_
I thought this raised such an interesting implicit question, and I get
asked about this enough that I thought it warranted a longer response.
There are actually a variety of reasons I prefer using HTML:
- rich semantics
- hypermedia support
- already standardized
- tooling support
Rich Semantics
==================
I’ve heard many folks say that HTML is primarily for presentation and not
for conveying information, and hence it isn’t suitable for API use.
Hogwash, I say! There are many web experts (like `Kimberly Blessing `_)
who would insist that markup is exactly for conveying semantics and
that presentation should be a CSS concern.
People seem to forget that web sites actually worked before CSS or
Javascript was invented! **I rely on this heavily** for my HTML APIs.
Hypermedia Support
====================
HTML offers , , and