def get_json(environ):
    content_type = environ.get('CONTENT_TYPE', '')
    if content_type != 'application/json':
        raise HTTPError(406, 'JSON required')

    try:
        return json.loads(read_body(environ))
    except ValueError as exc:
        raise HTTPError(400, exc)
Return the request body as JSON
dataset/ETHPy150Open saltstack/salt/salt/netapi/rest_wsgi.py/get_json