Checklist
With the following view:
@api_view(['POST'])
@parser_classes([JSONParser])
def my_view(request):
request.data['change_me'] = 'MyValue'
By sending a request with Content-Type: multipart/form-data (with at least one key/value pair, if it's empty it still goes through but doesn't trip up weirdly enough) one will observe the following behaviour:
AttributeError at $myViewsURL This QueryDict instance is immutable
What surprises me is that as I've specified the use of only the JSONParser, I should expect request.data to be a dict. I've tried other content-types and they are correctly rejected before parsing, but this one goes through.
Checklist
With the following view:
By sending a request with
Content-Type: multipart/form-data(with at least one key/value pair, if it's empty it still goes through but doesn't trip up weirdly enough) one will observe the following behaviour:AttributeError at $myViewsURL This QueryDict instance is immutableWhat surprises me is that as I've specified the use of only the
JSONParser, I should expectrequest.datato be adict. I've tried other content-types and they are correctly rejected before parsing, but this one goes through.