Question: I am trying to perform a POST request to create an article and I am getting this error `Request failed with status code 400 Bad Request: /api/articles/create/`. 

An article needs 3 attributes to be created:  

(1) title  

(2) body  

(3) author (the current user)

The router works fine since the POST request goes into the `post` method of the `ArticleCreateView` class. But I'm guessing that `serializer.is_valid()` is returning `False` for some reason. 
Also `print(request.data)` returns `{'title': 'hello', 'body': 'stuff'}`

Another mystery about Django is, how does the serializer know if I want to get, create or update something? In all the examples I've seen, the serializer magically seems to know this.

```
class ArticleCreateView(CreateAPIView):
    permission_classes = [IsAuthenticated]

    def post(self, request):
        serializer = ArticleSerializer(data=request.data)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data)
        return Response(serializer.errors)

class ArticleSerializer(serializers.ModelSerializer):
    class Meta:
        model = Article
        fields = '__all__'

    def create(self, validated_data):
        author = self.context['request'].user
        title = validated_data.get('title')
        body = validated_data.get('body')
        return Article.objects.create(author=author, title=title, body=body)

class Article(models.Model):
    author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
    title = models.CharField(max_length=100)
    body = models.TextField(max_length=100)
    date_updated = models.DateTimeField(auto_now=True)
    date_created = models.DateTimeField(auto_now_add=True)

```

Answer: 
if the value is changing in component but not in view(html) then after action in component use this.

```
import { ChangeDetectorRef } from '@angular/core';
constructor(private changeRef: ChangeDetectorRef){}
this.changeRef.detectChanges();

```

i hope it can help.
Possible solutions you can try

* you should check the logs for errors
* Assign clear type to "input" variable. ( try making it explicitly
public )
* "input" may be considered as a keyword, try using a different
variable name ( less likely )