comanage-dev - Re: [comanage-dev] Re: [JIRA] Work started: (CO-119) REST PUT
Subject: COmanage Developers List
List archive
- From: Marie Huynh <>
- To: Scott Koranda <>
- Cc: Benn Oshrin <>, comanage-dev <>
- Subject: Re: [comanage-dev] Re: [JIRA] Work started: (CO-119) REST PUT
- Date: Wed, 26 Oct 2011 16:31:41 -0700
I tested using curl. In short:
As far as I can tell, editing via PUT and POST does the same thing and neither overwrites the whole existing node and disabling POST should be fine. I can do that in cake/libs/router.php but I haven't figured out how to do it in routes.php yet.
Marie
On Thu, Oct 20, 2011 at 12:53 PM, Scott Koranda <> wrote:
>> 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
>
>
- [comanage-dev] Re: [JIRA] Work started: (CO-119) REST PUT, Benn Oshrin, 10/20/2011
- Re: [comanage-dev] Re: [JIRA] Work started: (CO-119) REST PUT, Scott Koranda, 10/20/2011
- Re: [comanage-dev] Re: [JIRA] Work started: (CO-119) REST PUT, Marie Huynh, 10/26/2011
- Re: [comanage-dev] Re: [JIRA] Work started: (CO-119) REST PUT, Scott Koranda, 10/20/2011
Archive powered by MHonArc 2.6.16.