Someone should be able to explain what I'm doing wrong here! I am trying to create a simple example of publishing AJAX in a Google App Engine application ... and I fail!
Here is a python application
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 is jQuery
$.ajax({ type: "POST", url: "myappengineURL", data: "address=" + sVerifiedEmail, success: function(msg) { alert("Data Saved: " + msg); }, });
Assuming I really know how to use jQuery and call an AJAX call ... why do I keep getting 405 error?
I rewrote this thing in six different ways, trying to get it to work ... and I can't! So far Iām watching advice from http://blog.pythoughts.com/posts/AJAX-with-Google-App-Engine#jqueryAjax and the Google AJAX RPC article in which I cannot post the link because StackOverflow says NO NO NO. None of these examples work for me.
What am I doing wrong?
source share