title: Unsupported media type Django API
body: <p>I'm new at Django and my project is in REST
  when i'm using postman to check URLs it's make this error:</p>
  <p>&quot;detail&quot;: &quot;Unsupported media type &quot;multipart/form-data; boundary=----WebKitFormBoundaryAU1ShXHTHrfcQr61&quot; in request.&quot;</p>
  <p>and when using curl this error occurred:</p>
  <p>{&quot;detail&quot;:&quot;JSON parse error - Expecting value: line 1 column 1 (char 0)&quot;}</p>
  <p>this is my view for an example URL:</p>
  <pre><code>@api_view([&quot;POST&quot;])
  def register(request):
      user_data = request.data
      if user_data:
          serializer = UserSerializers(data=user_data)
  
          if serializer.is_valid():
              registerInfo = {
                  'name': serializer.validated_data['name'],
                  'degImage': serializer.validated_data['degImage'],
              }
  
               serializer.save(registerInfo)
               return Response({
                  &quot;code&quot;: 200,
                  &quot;status&quot;: &quot;successful&quot;,
                  &quot;message&quot;: &quot;code was sent try to validate code&quot;
                  })
          else:
              return Response({
                  &quot;status&quot;: &quot;error&quot;,
                  &quot;error&quot;: &quot;Bad request&quot;
              })
      else:
          return Response({
              &quot;status&quot;: &quot;error&quot;,
              &quot;error&quot;: &quot;Empty request&quot;
          })
  </code></pre>
  <p>and this is serializer class:</p>
  <pre><code>class UserSerializers(serializers.Serializer):
      name = serializers.CharField(required=True)
      degImage = serializers.ImageField(required=True)
  
      def save(self, validated_data):
          user = Users(
              name=validated_data['name'],
              degImage=validated_data['degImage']
          )
          user.save()
          return user
  </code></pre>
  <p>and the model:</p>
  <pre><code>class Users(models.Model):
      name = models.CharField(max_length=20, null=True)
      degImage = models.ImageField(null=False, blank=False, default='detImage')
  </code></pre>