Re: Re: New Internet-Draft: JSON Hypertext Application Language
Craig McClanahan <[email protected]>
| Newsgroups | gmane.comp.web.services.rest,gmane.ietf.apps-discuss |
|---|---|
| Message-ID | <CANgkmLAkbz76KVMsE_aNyQdmJY+3TU3sC-4u_SoOW+odhWfJ1A@mail.gmail.com> |
I've written several APIs lately that contain a similar concept to the "links" abstraction with a useful extension -- we also include an "allowed" field that contains an array of the HTTP verbs that this user is allowed to perform against the URL specified by "href". Essentially, we're saving the client the need to do an OPTIONS call to determine what verbs are supported for that user. A use case for this is when displaying content that may or may not be editable (or can be deleted) by the requesting user. If so, the "allowed" field would say '[ "GET", "PUT", "DELETE" ]'. If not, it would just say '[ "GET" ]'. A client UI can use this information to decide whether or not to display enabled "Edit" or "Delete" buttons. Craig McClanahan On Tue, Feb 12, 2013 at 1:52 PM, Mike Kelly <[email protected]> wrote: > ** > > > Here's a slightly more useful link than the previous one! > > http://tools.ietf.org/html/draft-kelly-json-hal-05 > > On Tue, Feb 12, 2013 at 7:53 AM, Mike Kelly [email protected]> wrote: > > Hello all, > > > > fyi, I have updated the following internet draft: > > > > http://www.ietf.org/id/draft-kelly-json-hal-04.txt > > > > All thoughts, comments, suggestions, etc welcome > > > > Cheers, > > Mike > > -- > Mike > > http://twitter.com/mikekelly85 > http://github.com/mikekelly > http://linkedin.com/in/mikekelly123 > >