Skip to Content.
Sympa Menu

comanage-dev - Re: [comanage-dev] Re: [JIRA] Work started: (CO-119) REST PUT

Subject: COmanage Developers List

List archive

Re: [comanage-dev] Re: [JIRA] Work started: (CO-119) REST PUT


Chronological Thread 
  • From: Scott Koranda <>
  • To: Benn Oshrin <>
  • Cc: Marie Huynh <>, comanage-dev <>
  • Subject: Re: [comanage-dev] Re: [JIRA] Work started: (CO-119) REST PUT
  • Date: Thu, 20 Oct 2011 14:53:27 -0500

> Bringing this back to -dev since Scott started this thread originally...
>
> Out of the box, Cake will map POST to add() and POST or PUT to edit,
> depending on the URL format. So to make the switch described in the
> ticket, I'm not sure we actually need to change anything
> technically, just the documentation. (There wasn't any particular
> reason I started with POST instead of PUT.)
>
> So, should we?
>
> Well, if we follow the guide described in wikipedia
>
>
> http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_web_services
>
> the answer is yes, since PUT on an element replaces it, whereas POST
> on an element creates a new entry under the existing one.
>
> Another metric is idempotency (PUT is, POST isn't). In general, our
> edit operations are idempotent (and if they aren't perhaps they
> shouldn't be 'edit' operations), and so by this standard the answer
> is also yes.
>
> So I'd suggest
>
> (1) We update the documentation so all edit operations are PUT
> (2) We verify that all update operations are in fact idempotent
> (3) We test to make sure PUT requests are handled correctly
> (4) We disable POST for edits
>
> Thoughts?

+1

Scott




Archive powered by MHonArc 2.6.16.

Top of Page