So I was reading the documentation for the RequestHandler class in python, and I noticed that it supports several more methods other than the two that I’m used to, namely GET and POST.
Is it possible to add custom methods to the RequestHandler class or my class that implements RequestHandler to extend those methods even further?
For example, this would be a typical implementation of a webapp:
class MainPage (webapp.RequestHandler):
def get(self):
#do things
self.response.out.write("This was get")
Could I also add a method like this?
def SaveAttribute(self):
#do more things
self.response.out.write("Attribute saved")
I ask specifically so I can easily set up a jquery-ajax heavy app engine webapp, and if I could use custom methods like that with the “type” parameter in the .ajax() call it would make my life considerably easier than just handling everything through POST.
If this is not possible then is there a fairly straightforward way to do what I need to do?
You might want to take a look at ProtoRPC … it’s not exactly what you’re asking, but achieves the same kind of end-result.