Someone has to be able to explain what I'm doing wrong here! I'm trying to create the MOST simple example of an AJAX post to a Google App Engine app...and I'm failing!
Here is the app python
import cgi
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from django.utils import simplejson
class EmailItem(db.Model):
email = db.StringProperty(multiline=False)
date = db.DateTimeProperty(auto_now_add=True)
class EmailList(webapp.RequestHandler):
def get(self):
self.response.out.write("You see nothing!")
def post(self):
eitem = EmailItem()
eitem.email = self.request.get("address")
eitem.put()
self.response.out.write("success")
application = webapp.WSGIApplication([('/', EmailList)])
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
And here's the jQuery
$.ajax({
type: "POST",
url: "myappengineURL",
data: "address=" + sVerifiedEmail,
success: function(msg) {
alert("Data Saved: " + msg);
},
});
Assuming I actually know how to use jQuery and invoke that AJAX call...why do I keep getting a 405 Error?
I've re-written this thing six different ways trying to make it work...and I can't! So far I'm looking at advice from http://blog.pythoughts.com/posts/AJAX-with-Google-App-Engine#jqueryAjax and Google code's AJAX RPC article that I can't post a link to because StackOverflow says NO NO NO. Neither of these examples seem to work for me.
What am I doing wrong?