@process_request_body
def text_processor(entity):
    '''
    Attempt to unserialize plain text as JSON

    Some large services still send JSON with a text/plain Content-Type. Those
    services are bad and should feel bad.

    :param entity: raw POST data
    '''
    body = entity.fp.read()
    try:
        cherrypy.serving.request.unserialized_data = json.loads(body)
    except __HOLE__:
        cherrypy.serving.request.unserialized_data = body

    cherrypy.serving.request.raw_body = body
dataset/ETHPy150Open saltstack/salt/salt/netapi/rest_cherrypy/app.py/text_processor