def ParseJSONRequest(request):
 content_type = request.headers.get('Content-Type', '')
 if (not any((content_type.startswith(x) for x in _CONTENT_TYPES))):
  raise web.HTTPError(400, ('bad request content type: %s' % content_type))
 json_dict = json.loads(request.body)
 return json_dict

def ParseJSONRequest ( request ) : content_type = request . headers . get ( 'Content-Type' , '' ) if ( not any ( ( content_type . startswith ( x ) for x in _CONTENT_TYPES ) ) ) : raise web . HTTPError ( 400 , ( 'bad request content type: %s' % content_type ) ) json_dict = json . loads ( request . body ) return json_dict
parse the json-encoded contents of the request body and return the python data object .