axios post error wanted to post data to my backend in following format with body
/member/:_id/:relation/:owner_id
my axios call
await this.$axios.$post( 'http://localhost:3001/member/' + this.id, + this.relationship, + this.rootUser, user,{timeout: 120000 })
.then(response => {
this.errors = [];
this.$router.push("/family");
console.log('Working')
}).catch((error) => {
this.errors = error.response.data.errors;
console.log('somthing went wrong')
if (error.response.status === 400 ){
console.log(this.errors)
}
})
but its not working any one tell me where i miss
// try this, this does not generate the uri you want, check with:
console.log('http://localhost:3001/member/' + this.id, + this.relationship, + this.rootUser);
make sure you generate a right uri
// fix
$post(`http://localhost:3001/member/${this.id}/${this.relationship}/${this.rootUser}`
Please sign in or create an account to participate in this conversation.