Closed lesleyracs closed 3 years ago
Hi @lesleyracs ,
Try to add following property to your request body:
"related": [{
"refId": 1,
"ref": "article",
"field": "comments"
}]
Thanks, it worked.
I have encountered the very same problem, although the posted solution didn't work for me. I get still the same error and it doesn't matter how the body of the request look like.
My Strapi version is 3.4.1 and I have enabled permission for posting comments.
Catched on zoom and solved :)
Hi, i also had the same problem but with axios and formdata, in postman it worked.
const formData = new FormData();
formData.append('data', JSON.stringify(this.comment))
this.$axios.post('/comments/article:'+this.relatedid, formData)
.then(response => {
console.log(response)
})
.catch(error => {
console.log(error)
})
In console
Strapi version 3.4.5
@chandrastrez thats probably the issue with header Content-Type in axios as by default it send plain text. Force it to be a json and will work.
thats purely axios case, not the plugin.
Thanks it worked, with set header content type in axios
Hi, I installed the plugin following the instruction and added it to contentType, but I can't seem to make a successful POST request I keeping getting the following error
I have the following in my package.json
"knex": "^0.21.14", "sqlite3": "^5.0.0", "strapi": "3.4.1", "strapi-admin": "3.4.1", "strapi-connector-bookshelf": "^3.4.1", "strapi-connector-mongoose": "3.4.1", "strapi-plugin-comments": "^1.0.1-beta.2", "strapi-plugin-content-manager": "3.4.1", "strapi-plugin-content-type-builder": "3.4.1", "strapi-plugin-email": "3.4.1", "strapi-plugin-graphql": "3.4.1", "strapi-plugin-upload": "3.4.1", "strapi-plugin-users-permissions": "3.4.1", "strapi-utils": "3.4.1"
Any help will be appreciated