diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py index 238382364..3820b1f1b 100644 --- a/rest_framework/parsers.py +++ b/rest_framework/parsers.py @@ -51,6 +51,7 @@ class JSONParser(BaseParser): Parses JSON-serialized data. """ media_type = 'application/json' + decoder_class = json.JSONDecoder renderer_class = renderers.JSONRenderer def parse(self, stream, media_type=None, parser_context=None): @@ -62,7 +63,7 @@ class JSONParser(BaseParser): try: data = stream.read().decode(encoding) - return json.loads(data) + return json.loads(data, cls=self.decoder_class) except ValueError as exc: raise ParseError('JSON parse error - %s' % six.text_type(exc))