两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 |
public:it:restful [2016/12/07 09:42] – [HTTP method 与返回 status code 涵义表] oakfire | public:it:restful [2018/02/28 13:48] (当前版本) – 外部编辑 127.0.0.1 |
---|
===== Tools ===== | ===== Tools ===== |
* API 接口设计工具: [[http://swagger.io/|swagger]], 支持 json/[[.:yaml|yaml]] 描述, 工具链最齐全。 | * API 接口设计工具: [[http://swagger.io/|swagger]], 支持 json/[[.:yaml|yaml]] 描述, 工具链最齐全。 |
| * :!: swagger editor 工具, 如果 ''$ref'' 的值的格式错误,会出现不能定位到行的 error, 这时候只好一个个检查所有 $ref 的格式来甄别; |
| * :!: 还是 swagger editor 工具, mac chrome 下输入汉字会出现字母与汉字齐飞,还未解决。 |
* API 接口设计工具: [[http://raml.org/|raml]], [[.:yaml|yaml]] 描述, 比较精简干练,但工具还不成熟。 | * API 接口设计工具: [[http://raml.org/|raml]], [[.:yaml|yaml]] 描述, 比较精简干练,但工具还不成熟。 |
* API 框架: [[http://restify.com/|restify]], 效率上与express差不多, 但配套(throttling,监控)等比较方便。 | * API 框架: [[http://restify.com/|restify]], 效率上与express差不多, 但配套(throttling,监控)等比较方便。 |
* 认证 auth: HMAC Auth: [[http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html|amazon s3 REST auth]], 好像使用[[https://github.com/joyent/node-http-signature/blob/master/http_signing.md|http signing]] 比较好。 然后 restify 的自带插件有判断请求时间 | * 认证 auth: HMAC Auth: [[http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html|amazon s3 REST auth]], 好像使用[[https://github.com/joyent/node-http-signature/blob/master/http_signing.md|http signing]] 比较好。 然后 restify 的自带插件有判断请求时间 |
===== Articles ===== | ===== Articles ===== |
| * [[http://www.infoq.com/cn/articles/understanding-restful-style|理解本真的REST架构风格]] |
* [[http://www.infoq.com/cn/articles/designing-restful-http-apps-roth|RESTful HTTP的实践]] | * [[http://www.infoq.com/cn/articles/designing-restful-http-apps-roth|RESTful HTTP的实践]] |
* [[http://www.ruanyifeng.com/blog/2014/05/restful_api.html|阮一峰:RESTful API 设计指南]] | * [[http://www.ruanyifeng.com/blog/2014/05/restful_api.html|阮一峰:RESTful API 设计指南]] |
| |
===== Notes ===== | ===== Notes ===== |
* 在RESTful架构中,每个网址代表一种资源(resource),所以网址中不能有动词,只能有名词; 资源的 collection 用英文名词复数表示 | * 在RESTful架构中,每个网址代表一种资源(resource),所以网址中不能有动词,只能有名词; 资源的 collection 用英文名词复数表示 |