• she/her

annoying @vogon since 2014. still gay tho.
low energy software menace. i like taking photos, learning weird programming languages and being on the internet.


profile picture by
cohost.org/mleelunsford

there's another evil little thought in the back of my mind about APIs, and I'm putting this in a separate post.

If you really do need an API, here's how to sickos.jpg your RESTful API: XSLT!

Don't return JSON objects. Hand your user the grown-ups' document format: XML. It's nice and easy to consume (ha ha) and you can include a header that tells the browser about some nice XSLT transformations. It's kind of component-based: you use XML selectors to talk about the bit of the data you want and you can output how you want it to look in HTML instead. And of course, you can bundle up extra data from other queries and then look them up locally with God's own document transformation format.

Naturally to navigate you can just include links to other API endpoints, or per a nice bit of @tef style magic, HTML forms.

This is lunacy, I realise, but I also think that if there's anywhere it would shine it's RSS feeds.


You must log in to comment.

in reply to @zip's post: