mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-31 18:40:07 +03:00
Merge ca40b03b93
into 0950d3e0ef
This commit is contained in:
commit
6ab434d052
|
@ -50,10 +50,7 @@ class JSONParser(BaseParser):
|
|||
|
||||
def parse(self, stream, media_type=None, parser_context=None):
|
||||
"""
|
||||
Returns a 2-tuple of `(data, files)`.
|
||||
|
||||
`data` will be an object which is the parsed content of the response.
|
||||
`files` will always be `None`.
|
||||
Returns a dict of parsed items.
|
||||
"""
|
||||
parser_context = parser_context or {}
|
||||
encoding = parser_context.get('encoding', settings.DEFAULT_CHARSET)
|
||||
|
@ -74,10 +71,7 @@ class YAMLParser(BaseParser):
|
|||
|
||||
def parse(self, stream, media_type=None, parser_context=None):
|
||||
"""
|
||||
Returns a 2-tuple of `(data, files)`.
|
||||
|
||||
`data` will be an object which is the parsed content of the response.
|
||||
`files` will always be `None`.
|
||||
Returns a dict of parsed items.
|
||||
"""
|
||||
assert yaml, 'YAMLParser requires pyyaml to be installed'
|
||||
|
||||
|
@ -100,10 +94,7 @@ class FormParser(BaseParser):
|
|||
|
||||
def parse(self, stream, media_type=None, parser_context=None):
|
||||
"""
|
||||
Returns a 2-tuple of `(data, files)`.
|
||||
|
||||
`data` will be a :class:`QueryDict` containing all the form parameters.
|
||||
`files` will always be :const:`None`.
|
||||
Returns a dict of parsed items.
|
||||
"""
|
||||
parser_context = parser_context or {}
|
||||
encoding = parser_context.get('encoding', settings.DEFAULT_CHARSET)
|
||||
|
@ -147,6 +138,9 @@ class XMLParser(BaseParser):
|
|||
media_type = 'application/xml'
|
||||
|
||||
def parse(self, stream, media_type=None, parser_context=None):
|
||||
"""
|
||||
Returns a dict of parsed items.
|
||||
"""
|
||||
assert etree, 'XMLParser requires defusedxml to be installed'
|
||||
|
||||
parser_context = parser_context or {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user