def ParseJSONRequest(request):
  """Parse the JSON-encoded contents of the request body and return
  the python data object.
  """
  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)
  #logging.debug('parsed: %s' % repr(json_dict))
  return json_dict
dataset/ETHPy150Open viewfinderco/viewfinder/backend/www/www_util.py/ParseJSONRequest/original