retrieve data from post requests in the form of JSON structure
Question: I am working on app engine in python, with a handler to response the post
requests from javascript, the post requests are sent in JSON structure, in
firebug console window, the Http request is shown:

    
    
    [{"name":"John","value":"student"},{"name":"Mike","value":"teacher"}]
    

Can anyone tell me how to get this JSON data off the post requests in the
handler? thanks in advance.


Answer: 
    from google.appengine.ext import webapp
    import json
    
    class Handler(webapp.RequestHandler):
        def post(self):
    
            # Convert JSON from the request to Python objects.
            data = json.loads(self.request.body)
    
            # For your sample input, data will be a list of dicts.
            for person in data:
                name = person['name']
                value = person['value']
    

