Created
June 19, 2011 18:35
-
-
Save DavidYKay/1034571 to your computer and use it in GitHub Desktop.
App Engine Get Tutorial
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
class ContactsHandler(webapp.RequestHandler): | |
def get(self): | |
# Get user ID from URL | |
user_id = ... | |
# Make query to Datastore | |
data = query(user_id, ...) | |
# Encode to JSON | |
jsonObject = jsonEncode(data) | |
self.response.headers['Content-Type'] = 'application/json' | |
self.response.out.write(jsonObject) | |
def post(self): | |
# Check user input | |
# Accept it | |
# Store it | |
# Reply with "Success" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment