Skip to content

Instantly share code, notes, and snippets.

@DavidYKay
Created June 19, 2011 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidYKay/1034571 to your computer and use it in GitHub Desktop.
Save DavidYKay/1034571 to your computer and use it in GitHub Desktop.
App Engine Get Tutorial
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