def deserialize(self, data):
        '''
        Deserialize the data based on request content type headers
        '''
        ct_in_map = {
            'application/x-www-form-urlencoded': self._form_loader,
            'application/json': json.loads,
            'application/x-yaml': yaml.safe_load,
            'text/yaml': yaml.safe_load,
            # because people are terrible and don't mean what they say
            'text/plain': json.loads
        }

        try:
            # Use cgi.parse_header to correctly separate parameters from value
            header = cgi.parse_header(self.request.headers['Content-Type'])
            value, parameters = header
            return ct_in_map[value](data)
        except KeyError:
            self.send_error(406)
        except __HOLE__:
            self.send_error(400)
dataset/ETHPy150Open saltstack/salt/salt/netapi/rest_tornado/saltnado.py/BaseSaltAPIHandler.deserialize