http - Rel on REST API collection links -


i'm working on rest api, , 1 of resources collection of other resources, should return that:

{     "links":[         {             "href":"http://my.rest.api/document/1",             "rel":"something"         },         {             "href":"http://my.rest.api/document/2",             "rel":"something"         }     ] } 

my question "rel" property. don't understand use. specify http method use? can explain me?

thanks lot

html 4 defines set of link types. key understandig sentence:

user agents, search engines, etc. may interpret these link types in variety of ways. example, user agents may provide access linked documents through navigation bar.

the same true rest. server , client must agree meaning possible values of rel. these come mind:

  • parent: parent collection resource child of
  • next: next resource in collection (if collection ordered)
  • prev: previous resource in collection (if collection ordered)
  • children: collection of child resources

there can many more. concrete rel values heavily depend on resources.

edit: rel attributes nothing http verbs. give hint nature of relation of current resource different resource.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -