<s> from django . utils import simplejson as json <EOL> def get_request_dict ( request ) : <EOL> """<STR_LIT>""" <EOL> data = request . body <EOL> content_type = request . META . get ( "<STR_LIT>" ) <EOL> if content_type is None : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> if content_type . startswith ( "<STR_LIT:application/json>" ) : <EOL> try : <EOL> return json . loads ( data ) <EOL> except ValueError : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> else : <EOL> raise Exception ( "<STR_LIT>" % content_type ) </s>
