rest api best practise
来源:互联网 发布:人工智能计算器v3.6.0 编辑:程序博客网 时间:2024/06/05 10:05
Mainly cited from http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api with my thinking.
1.always use nouns.
2.always use ssl.
3.prefer post to put.
4.version your api.
5.internal filtering, sorting, searching.(this needs to think more in real use case scenario)
6.update/create return 201 with location.
7.json only response.
8.prefer return gzip in response.
9.set rate limiting.
10.rest api is always stateless.(no cookies or sessions)
11.if use ssl, just simple genereate auth token or use oath(= =)
12.the representation of any errors should be the same as any resources.
13.400 series status code for client issues, 500 series for server issues.
14.the error content should include { errorcode, message, details, suberrors[] }.
Finally, rest api is the ui to the developers, make it pretty and easy to use:-)
- rest api best practise
- Best practices for the logging REST API
- htop best practise
- scala best practise
- REST API
- REST api
- rest api
- REST API
- REST API
- Rest API
- API&REST API
- [原创]VMware best practise[VMware最佳实践]
- Best Practise - K2 Host Server Connections
- Best Practise for Runner/Service on Nexenta
- Sql server best practise for Index
- 两个REST client API
- C#调用REST API
- REST API 管理
- CodeForces 468B Two Sets 二分匹配
- 九度 题目1456:胜利大逃亡
- Android蓝牙串口程序开发
- glib交叉编译说明
- matlab 常用的函数理解
- rest api best practise
- grub rescue 模式
- Xcode调试-获取APP中当前页面所对应的controller
- 安全卫士——Day05_2
- centos 6.3 64位编译 hadoop2.6.0 (2.5.2 2.5.1 均可行)
- hibernate annotation 之 主键生成策略
- java模板方法设计模式
- 第17周【项目 4 - 日期结构体】(1)
- 求两人生日相差多少天