路线片段命名法

时间:2015-05-07 10:00:31

标签: rest routes

给定一个route / users / 1234 / comments,这些名称是什么?

/
/users
/users/1234
/users/1234/comments

子路由,父路由,路由片段?

1 个答案:

答案 0 :(得分:1)

我会称他们为NSMutableDictionary *firstDic=[[NSMutableDictionary alloc]init]; [data setValue:@"abc@gmail.com" forKey:@"email"]; NSMutableDictionary *secondDic=[[NSMutableDictionary alloc]init]; [userInfo setValue:firstDic forKey:@"user"]; relationship routes

您可以通过阅读以下内容进行深入探讨:http://restful-api-design.readthedocs.org/en/latest/relationships.html

  

正如我们在参考资料中看到的那样,资源是其中的基本单位   RESTful API设计。资源模型对象来自应用程序数据   模型。

     

资源不是孤立存在的,而是与其他资源有关系   其他资源。有时这些关系存在于   应用程序数据模型中的映射对象,有时也是它们   特定于RESTful资源。

     

RESTful架构风格的原则之一就是这些   关系由表示a的表示的超链接表示   资源。
  ...