same method for GET and POST

2 views
Skip to first unread message

rkm...@gmail.com

unread,
Jan 25, 2008, 4:38:49 PM1/25/08
to we...@googlegroups.com
how do i create a class that has same definitions for both GET and POST?

Adam Atlas

unread,
Jan 25, 2008, 4:40:47 PM1/25/08
to we...@googlegroups.com

On 25 Jan 2008, at 16:38, rkm...@gmail.com wrote:
> how do i create a class that has same definitions for both GET and
> POST?

class blah:
def GET(self):
...
POST = GET

I think that would work.

David Terrell

unread,
Jan 25, 2008, 9:26:06 PM1/25/08
to we...@googlegroups.com
On Fri, Jan 25, 2008 at 01:38:49PM -0800, rkm...@gmail.com wrote:
> how do i create a class that has same definitions for both GET and POST?

Read RFC 2616, three times, then come back and tell us you figured it out.

POST is for side-effects. GET is for no side-effects. They are not
the same thing. They cannot be the same thing.

--
David Terrell
d...@meat.net
((meatspace)) http://meat.net/

Randall Randall

unread,
Jan 25, 2008, 9:57:27 PM1/25/08
to we...@googlegroups.com
On Jan 25, 2008, at 9:26 PM, David Terrell wrote:
> On Fri, Jan 25, 2008 at 01:38:49PM -0800, rkm...@gmail.com wrote:
>> how do i create a class that has same definitions for both GET and
>> POST?
>
> Read RFC 2616, three times, then come back and tell us you figured
> it out.
>
> POST is for side-effects. GET is for no side-effects. They are not
> the same thing. They cannot be the same thing.

"But this has to be a link for look-n-feel reasons, and some
of our customers have browsers with javascript disabled..."

Web designers have different requirements than we developers,
and educating or firing the designer is not always an option.

--
Randall Randall <ran...@randallsquared.com>
"If I can do it in Alabama, then I'm fairly certain you
can get away with it anywhere." -- Dresden Codak

bubblboy

unread,
Jan 25, 2008, 9:58:50 PM1/25/08
to we...@googlegroups.com
David Terrell wrote:
> On Fri, Jan 25, 2008 at 01:38:49PM -0800, rkm...@gmail.com wrote:
>> how do i create a class that has same definitions for both GET and POST?
>
> Read RFC 2616, three times, then come back and tell us you figured it out.
>
> POST is for side-effects. GET is for no side-effects. They are not
> the same thing. They cannot be the same thing.

That's funny, I only read it once and I immediately thought "Hey,
actually, these methods act /exactly/ the same when, for example, they
are trying to access a resource that does not exist or that they have no
permission to."

Relax dude.

To the OP: did Adam Atlas' solution [1] not suffice? What exactly do you
want to achieve?

Greetings,
b^4

[1] http://groups.google.com/group/webpy/msg/b84b97058c3a76fe

Ben Hoyt

unread,
Jan 27, 2008, 1:16:44 PM1/27/08
to we...@googlegroups.com
Adam's right, "POST = GET" should work fine.

As for the "whether or not to do it" debate, I wrote a blog entry asking that question some time ago, and discovered many reasons not to do it, and a few reasons you might want to do it (see the comments):
    http://blog.micropledge.com/2007/06/get-to-do-posts-job/

It was interesting to note that Paul Buchheit (one of the creators of Gmail) is pretty pragmatic on the issue:
    http://paulbuchheit.blogspot.com/2007/06/dogmatic-programmer-when-software.html

-Ben
--
Ben Hoyt, http://benhoyt.com/
Reply all
Reply to author
Forward
0 new messages