7 Rules for REST API URI Design
REST API设计的7个原则:
URI = scheme "://" authority "/" path [ "?" query ] [ "#" fragment ]
- A trailing forward slash (/) should not be included in URIs:URI最后的字母不应为斜杠
http://api.canvas.com/shapes/ - Forward slash separator (/) must be used to indicate a hierarchical relationship:斜杠之间表明了层级关系
http://api.canvas.com/shapes/polygons/quadrilaterals/squares - Hyphens (-) should be used to improve the readability of URIs:可用横划线提高可读性
http://api.example.com/blogs/guy-levin/posts/this-is-my-first-post - Underscores (_) should not be used in URIs:不要使用下划线
- Lowercase letters should be preferred in URI paths:用小写
- File extensions should not be included in URIs:不要包含文件扩展名
http://api.college.com/students/3248234/courses/2005/fall.json http://api.college.com/students/3248234/courses/2005/fall - Should the endpoint name be singular or plural?:用复数
http://api.college.com/students/3248234/courses
Amazon Goal, Strategy, Tactic about AWS, Prime and Whole Foods.
At its core Amazon is a services provider enabled — and protected — by scale.



网友评论