英文:
Is "https://google.com/search?query=sea" RestAPI?
问题
我最近学习了RestAPI。
关于这个问题,如果我使用GET方法并以www.google.com/search?query=sea的格式获得HTML作为响应值,我可以称之为RestAPI吗?
我认为自我描述性、HATEOAS和统一接口的要求都得到了满足,因为它是HTML格式。但是,我认为它违反了识别资源的原则。因此,我认为这只是HTTP方法。
这样理解对吗?请回答,谢谢!
英文:
I recently studied RestAPI.
I have question about that If I used get method in a format like www.google.com/search?query=sea , and got html as a response value, can I call it restapi?
I think the self-descriptive, hateos of the uniform interface is satisfied because it is in html format. However, I think it violates the identifying resource. Therefore I think this is just http method.
Is it right? please answer. thank you!
答案1
得分: 0
REST 是在 1990 年代标准化全球网络时使用的架构约束集合。
> 我认为它违反了标识资源。
资源标识属于 uniform interface 约束;它只是说我们使用资源标识符来... 标识资源。
https://www.google.com/search?query=sea
这就是一个资源标识符,所以你满足了这个约束。
> 我可以称它为 restapi 吗?
从技术上讲?当然可以。你可以再引用 Fielding
但就沟通而言,如果你想被理解,那你需要验证你的受众是否以与你的意思相同的方式理解这些标签。
另请参阅 语义扩散。
英文:
REST is the collection of architectural constraints that were used in the standardization of the world wide web during the 1990s.
> I think it violates the identifying resource.
Resource identification falls under the uniform interface constraint; it just says that we use resource identifiers to... identify resources.
https://www.google.com/search?query=sea
That right there would be a resource identifier, so you are satisfying that constraint.
> can I call it restapi?
Technically? yes, of course. You could cite Fielding again
But as a matter of communication, if you want to be understood then you need to verify that your audience understands the labels that you are using the same way that you mean them.
See also Semantic Diffusion.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论