从客户角度定义 RESTful
我是否可以假设,如果我需要对某个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可能是 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.