为什么 API 设计如此重要的一个原因是,它可以帮助最终消费者使用您的 API,他们的需求应该成为设计和构建出色 API 的指路明灯。 Eolink 翻译,原文地址:https://swagger.io/resources/articles/best-practices-in-api-design/
我非常赞成approach that Stripe has taken to API versioning- URL包含一个主版本号(比如http://shonzilla/api/v1/customers/1234) ),但是API还包含基于日期的子版本(比如http://shonzilla/api/v1.2/customers/1234),可以通过配置HTTP请求头来进行选择。这种情况下,主版本确保API结构总体稳定性,而子版本会考虑细...
1. RESTful API 设计最佳实践 https://blog.philipphauer.de/restful-api-design-best-practices/ 项目资源的URL应该如何设计?用名词复数还是用名词单数?一个资源需要多少个URL?用哪种HTTP方法来创建一个新的资源?可选参数应该放在哪里?那些不涉及资源操作的URL呢?实现分页和版本控制的最好方法是什么?因为有太多的...
{ "rel":"edit", "method": "put", "href":"/api/status/12345" } ]}} 四、参考链接 RESTful API Design: 13 Best Practices to Make Your Users Happy, by Florimond Manca API design, by MicroSoft Azure (完) 来源:t.cn/EhVCDAW发布...
原文出处:RESTful APIDesign. Best Practices in a Nutshell. 原文:RESTfulAPIDesign. Best Practices in a Nutshell. 作者:Philipp Hauer 项目资源的URL应该如何设计?用名词复数还是用名词单数?一个资源需要多少个URL?用哪种HTTP方法来创建一个新的资源?可选参数应该放在哪里?哪些不涉及资源操作的URL呢?实现分页和版...
原文:https://blog.philipphauer.de/restful-api-design-best-practices/ 项目资源的URL应该如何设计?用名词复数还是用名词单数?一个资源需要多少个URL?用哪种HTTP方法来创建一个新的资源?可选参数应该放在哪里?那些不涉及资源操作的URL呢?实现分页和版本控制的最好方法是什么?因为有太多的疑问,设计RESTful API变得很...
https://blog.philipphauer.de/restful-api-design-best-practices/ 译文:https://segmentfault.com/a/1190000011516151
以下是设计RESTful API的是个最佳实践: 1. 使用名词而不是动词 为了易于理解,为资源使用下面的API结构: Resource Getread Postcreate Putupdate Delete /cars 返回一个car的列表 创建一个新的car 更新car的信息 删除所有的car /cars/2 返回指定的car
RPC这种耦合性高,依赖于库的API,大家使用过程务必要非常小心。 参考文献 [1]Architectural Styles and the Design of Network-based Software Architectures [2]10 Best Practices for Better RESTful API [3]RESTful API Designing guidelines — The best practices 本文原创自PHP技术大全QQ群的js同学之手。
There is a long debate going on the internet, about the best ways to design the APIs, and is one of the most nuanced. There are no official guidelines defined for the same. The API is an interface, through which many developers interact with the data. A good designed API is always ver...