Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> REST is an architectural style

This is one of the things I don't understand. Architectural style for what, interfaces?

> must employ hyperlinks

A weird restriction imho. Links make sense for web pages read by humans. But APIs? Yes, links are nice to quickly get to know the API, to test it via a browser but they're not that important.



> > must employ hyperlinks

> A weird restriction imho. Links make sense for web pages read by humans. But APIs? Yes, links are nice to quickly get to know the API, to test it via a browser but they're not that important.

The use of hypermedia is central to REST -- if you think "hyperlinks aren't important to APIs", that's equivalent to reject the REST architecture.

In REST, you don't need a map of service endpoints or conventions about locations to consume an API. You need to know one resource location, and understand the representation of the resource that can be retrieved there, and from that the rest of the API should be discoverable -- moreover, the locations of the other resources can change and you can still use the API.

(And this is scalable, so that what is from one perspective the "root" resource location for one API can also be a link provided by another resource, such that if you know how to retrieve the latter resource, the location of the other API root can change and you can still consume it.)


Architectural style for building scalable applications. Fielding wasn't talking about APIs specifically.

There's nothing "weird" about links in APIs. For an easy metaphor, think of "links" in APIs as you think of foreign keys in your database tables. Link doesn't just mean something you can click :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: