Loading ...
Sorry, an error occurred while loading the content.

19022Re: [rest-discuss] Link relation for adding a resource

Expand Messages
  • Jan Algermissen
    Sep 1, 2012
      On Aug 31, 2012, at 6:07 PM, Paul Cohen wrote:

      > Hi,
      > I would like to define, in JSON, a link that provides a way to add a
      > new resource to a collection of resources.

      HTTP POST has that semantic already, there is no need to use a link relation for that.

      All you need to know is that some resource has collection semantics, so you should tell the client that /photos is a collection rather than focussing on the action.

      E.g. tell the client that /photos/ is the 'photos collection' (you can use a link rel for that, or, e.g. an AtomPub service document, or a specific media type you design) and that's it. That POST is for adding items is known from HTTP already.


      > I'm considering this:
      > "link": {
      > "href": "/photos/",
      > "type": "image/tiff",
      > "method": "POST",
      > "rel": "new",
      > "title": "Add new photo"}
      > I'd appreciate any comments on the link representation above. In
      > particular I'm interested in suggestions for the relation type - I use
      > "new" above. I've seen "new" being used in similar cases but it's not
      > an officially registered relation type here:
      > * http://www.iana.org/assignments/link-relations/link-relations.xml
      > * http://www.w3.org/TR/html401/types.html#h-6.12
      > * http://microformats.org/wiki/existing-rel-values
      > And there's no registered relation type with new/add/append-like
      > semantics. Well maybe "create-form" on the mircroformats page, but
      > that doesn't really seem appropriate.
      > /Paul
      > --
      > Paul Cohen
      > www.seibostudios.se
      > mobile: +46 730 787 035
      > e-mail: paul.cohen@...
    • Show all 11 messages in this topic