38 ms·
I think the thing that keeps people from adopting HTML as a content type for APIs is the fact that tools don't parse HTML into native data structures. All the t
by stanleydrew 14y ago
I think the thing that keeps people from adopting HTML as a content type for APIs is the fact that tools don't parse HTML into native data structures. All the tools build up a DOM structure, which makes sense since that's what HTML is generally used to represent.
If we could agree to use some subset of HTML that would map to native objects in most languages, then we could build tools around that standard.
Or we could approach from the other side and just try to bolt on some hypermedia features to JSON, as projects like HAL are attempting to do. This seems to have more traction at the moment.
- jon_moore 14y agoYep, this is really the point. If we think hypermedia APIs give you evolvability, then we've got to figure out how to do it; we don't have libraries for that sitting around, so someone has to do some work somewhere. HAL is going for "start with something clean for machines (JSON and XML), layer in hypermedia, get people to adopt it." This seems like a perfectly reasonable approach. I'm suggesting another approach, which is "start with something that supports hypermedia and is already ubiquitous on the web, and figure out how to get machines to make sense of it." I'm not sure either one is easy, so it's worth having multiple horses in the race, I think.