Mike Orr wrote:
> On Jan 29, 2008 11:15 AM, Ian Bicking <[EMAIL PROTECTED]> wrote:
>> I think using POST is okay; if you are using _action=PUT it isn't a PUT
>> anyway, and it feels like it's not much more than HTTP verb push-ups.
>> POST over a resource updates the resource in some fashion; updating a
>> resource in-place via POST is okay (PUT might be better, but
>> not-really-a-PUT *isn't* better).
> 
> I generally agree with you, and I keep going back and forth whether to
> use map.resource in my own applications.  Because what does it really
> matter if you use POST or PUT?  Users can't effectively predict URLs
> across applications anyway, and there's no practical reason to; e.g.,
> no Google GWebsite that's a common front end for interacting with a
> variety of sites.  "/resource/" vs "/resource/1" is a good idea, but
> I'm not sure the rest of it matters.
> 
> Are there any other practical arguments for a REST-like
> add/edit/delete, or is it all just academic ideology?

POST or PUT over a resource automatically invalidates all caches (at 
least all that see the request), so that is of some benefit.  I like PUT 
insofar as it is clearly symmetric with GET.  If there is not a strong 
symmetry then I don't see any purpose to it.

POST /resource/1?_action=PUT doesn't invalidate any caches, and so it's 
not just rather useless, it's actually counterproductive.

Technically you could use Accept headers to handle a resource with 
multiple representations.  But the Accept header totally blows; browsers 
lie about it (they claim they'd prefer XML over HTML?!?) and it totally 
messes up caching and the fixes are hard to handle.

> But still, something needs to be done for Pylons, and map.resource
> exists, so I guess a fair number of people are using it.

Well, for services I think the atompub layout is nice.  For rendered 
HTML and HTML forms it doesn't work that well IMHO.

   Ian

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to