TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

REST APIs must be hypertext-driven (2008)

27 点作者 dvaun超过 4 年前

5 条评论

dozzman超过 4 年前
Most of the APIs I use and build are best suited as RPC systems rather than hypermedia networks, so implementing the entire REST idea has never been immediately useful. Broadly the real consumers of RESTful APIs are not generic hypermedia clients (generalisation of browsers) which are able to traverse your flavour of hypermedia, but the things operating those clients. Most of the time, those “things” are dumb business logic applications that can’t explore the hypermedia to discover new functionality and furthermore are not designed to do anything with it anyway.<p>If it is a human traversing the hypermedia however, they’re able to derive a lot of understanding about the API and its features, as if the API is self documenting, but that generally only occurs during the development and debugging stages. After that the hypermedia is useless to the dumb business logic. Also I’m sure most humans prefer to browse the documentation on the alternative World Wide Web hypermedia network, as any good API would have documentation published there.<p>All in all hypermedia is mostly useful for intelligent consumers, so if that is not the consumer of your API and you suspect instead the consumer will be static business logic (the vast majority of cases) then REST will not be particularly useful. As I mentioned an interesting use case would be bundling up documentation into the API itself and hyperlinking between that and related URLs, however the overhead is generally not worth it since you’re likely to do it better with documentation site.
评论 #24429297 未加载
cryptos超过 4 年前
There was a great article about the common misconceptions about REST recently: <a href="https:&#x2F;&#x2F;twobithistory.org&#x2F;2020&#x2F;06&#x2F;28&#x2F;rest.html" rel="nofollow">https:&#x2F;&#x2F;twobithistory.org&#x2F;2020&#x2F;06&#x2F;28&#x2F;rest.html</a><p>The longer I think about it, the more I come to the conclusion that REST is simply not useful for application development in general. It is no accident that most APIs called &quot;RESTful&quot; by their creators are violating basic REST principles. But REST has some useful attributes even if not used strictly - caching comes to mind.<p>The question is: should we have another &quot;standard&quot; for web application development? Something more like RPC? There are some approaches, but nothing that I would call a broadly accepted standard. How should such a standard look like?
评论 #24430100 未加载
fbn79超过 4 年前
Does JSON API (<a href="https:&#x2F;&#x2F;jsonapi.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jsonapi.org&#x2F;</a>) follow all this rules? If not what rules is not followeb and why in your opinion?
lowercase1超过 4 年前
I&#x27;ve never really seen a good explanation of why REST is a meaningful concept. Why REST? Why these requirements? What do you mean stateless? What is bad about deviating?
评论 #24426660 未加载
评论 #24428751 未加载
评论 #24426720 未加载
solipsism超过 4 年前
This is equivalent to complaining that rap isn&#x27;t music. The meanings of words change, sometimes in ways we consider irrational or inconvenient in various ways. Complaining about it never seems to help.<p>I long ago stopped complaining to people in this forum about the difference between &quot;it&#x27;s&quot; and &quot;its&quot;. In response, please stop trying to reclaim the term REST. It&#x27;s long gone.
评论 #24429885 未加载