从客户角度定义 RESTful

发布于 2024-12-20 18:35:25 字数 191 浏览 1 评论 0原文

我是否可以假设,如果我需要对某个 url 执行 HTTP POST 来获取一串数据(JSON 或其他),那么它是一个 RESTful API?或者像这样的通用 api 还有另一个术语吗?

据我所知,服务器上可能有更多的幕后功能可以确定它是否是真正的 RESTful API,但就客户端而言,还有其他特征吗嗯>?

Can I just assume if I need to do a HTTP POST to a url to get back a string of data (JSON or otherwise) that it is a RESTful API? Or is there another term for a general api like this?

I understand that there is probably more behind the scenes on the server that could determine if it is a true RESTful API, but as far as the client can tell, are there any other characteristics?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

没有心的人 2024-12-27 18:35:25

它可能是 RESTful API 的一部分;这听起来当然不是不兼容的。如果是 RESTful,您还可以广泛使用 HTTP GET 来读取内容(通过内容协商来确定格式(表示形式)以传递值),正确使用 HTTP 动词来表达真正含义(而不是一切都是 POST!)以及 HTTP 错误代码的含义(并非一切都是 200!)并且将有超文本链接以允许定位一切。

REST 只是编写动态网站的一种方式。这实现了一个服务。

It might be part of a RESTful API; it certainly doesn't sound incompatible with one. If it was RESTful, you'd also have extensive use of HTTP GET for doing reading of things (with content negotiation to determine the format — the representation — to deliver the values as), proper use of HTTP verbs for the true meaning (not everything is a POST!) and HTTP error codes for their meanings (not everything is a 200!) and there would be hypertext linking to allow everything to be located.

REST is just a way of writing a rather dynamic website. That implements a service.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文