Is it possible web.py actually supports *any* verb and the browser is
the limitation?  This example, using jQuery, will work even with made-
up verbs like AJAX:

<input type="button" id="button1" name="button1" value="get"
onclick="$.ajax({
        type: 'GET',
        url: 'ajax',
        success: function(msg){
            alert('Data Saved: ' + msg);
        }
    });"/>

<input type="button" id="button2" name="button2" value="post"
onclick="$.ajax({
        type: 'POST',
        url: 'ajax',
        success: function(msg){
            alert('Data Saved: ' + msg);
        }
    });"/>

<input type="button" id="button3" name="button3" value="ajax"
onclick="$.ajax({
        type: 'AJAX',
        url: 'ajax',
        success: function(msg){
            alert('Data Saved: ' + msg);
        }
    });"/>

--------------------------------------

class ajax:
    def GET(self):
        return "you got me"
    def POST(self):
        return "your postedme"
    def AJAX(self):
        return "ajax isn't a real verb... but it works"

Using made-up verbs has downsides.  As I recall firefox and safari
will send anything, opera won't send anything non standard, and IE
seems random (something about changing some verbs).  The good news is
it looks like all four 'support' GET/POST/PUT/DELETE.

On Dec 20, 7:25 pm, "Dave Warnock" <[email protected]> wrote:
> Thanks, that makes routing nice and neat.
>
> 2008/12/21 Aaron Swartz <[email protected]>:
>
>
>
> >> The docs do not seem to make it clear if web.py supports HTTP PUT and
> >> DELETE as well as GET and POST?
>
> > Yes, they work.
>
> >> It looks from application.py _delegate (line 352) that HEAD is turned
> >> into a GET. Can't see any mention of other http verbs so can I assume
> >> they work?
>
> > That's only if there's no HEAD method, I think.
>
> --
> Dave Warnock:http://42.blogs.warnock.me.uk
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to