Want to send a post request, but for some reason returns me 400 pages and comes in response This field is required
post.vue
methods: { sendMessage () { let options = { params: { title: this.title body: this.textField article: this.article.id }, headers: { 'Content-Type': 'application/json' }, } HTTP.post('/comments/', options) .then(response => { this.$message({ type: 'success', message: 'Your comment is waiting for claims' }) console.log(response) }) .catch(err => { console.log(err) }) },
views.py
class CommentsView(viewsets.ModelViewSet): queryset = Comments.objects.all() serializer_class = CommentSerializer