美文网首页
每周阅读(06/19/2017)

每周阅读(06/19/2017)

作者: Jeff | 来源:发表于2017-06-25 20:32 被阅读7次

    7 Rules for REST API URI Design

    REST API设计的7个原则:
    URI = scheme "://" authority "/" path [ "?" query ] [ "#" fragment ]

    1. A trailing forward slash (/) should not be included in URIs:URI最后的字母不应为斜杠
      http://api.canvas.com/shapes/
    2. Forward slash separator (/) must be used to indicate a hierarchical relationship:斜杠之间表明了层级关系
      http://api.canvas.com/shapes/polygons/quadrilaterals/squares
    3. Hyphens (-) should be used to improve the readability of URIs:可用横划线提高可读性
      http://api.example.com/blogs/guy-levin/posts/this-is-my-first-post
    4. Underscores (_) should not be used in URIs:不要使用下划线
    5. Lowercase letters should be preferred in URI paths:用小写
    6. 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
    7. Should the endpoint name be singular or plural?:用复数
      http://api.college.com/students/3248234/courses

    Amazon New Customer

    Amazon Goal, Strategy, Tactic about AWS, Prime and Whole Foods.

    At its core Amazon is a services provider enabled — and protected — by scale.

    AWS

    Prime

    Whole Foods

    相关文章

      网友评论

          本文标题:每周阅读(06/19/2017)

          本文链接:https://www.haomeiwen.com/subject/awsrcxtx.html