1. Matthew Schinckel
  2. django-rest-api

Commits

Matthew Schinckel  committed 7cdc251

Some clients do not send in Content-Type, so we need to sniff

  • Participants
  • Parent commits ef385c9
  • Branches default

Comments (0)

Files changed (1)

File rest_api/serializers/__init__.py

View file
  • Ignore whitespace
     serializer = deserializers.get(content_type, None)
     
     if serializer == post:
+        inspected = inspect_content(request.raw_post_data)
+        if inspected:
+            return inspected
         if len(request.POST):
             return serializer.deserialize(request.POST)
         return serializer.deserialize(QueryDict(request.raw_post_data))