Last active
August 29, 2015 14:08
-
-
Save fisherds/ef5c59ffd31237fb9d07 to your computer and use it in GitHub Desktop.
Example from our ServerTime demo of a simple Python AppEngine handler that returns JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import webapp2 | |
| class ServerTime(webapp2.RequestHandler): | |
| def get(self): | |
| self.response.headers["Content-Type"] = "application/json" | |
| #self.response.headers.add_header("Access-Control-Allow-Origin", "*") | |
| response = {"message": "Hello AJAX!"} | |
| self.response.out.write(json.dumps(response)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment