It's working when making a request with postman for when trying to with axios in reactjs its showing 400 status code
I have already tried - adding removing headers - adding boundary:--foo
handleSubmit(event) {
let data = new FormData();
data.append("username", this.state.username)
data.append("password", this.state.password)
data.append("confirm_password", this.state.confirm_password)
data.append("email", this.state.email)
event.preventDefault();
axios({
method: 'post',
url: 'http://localhost:8000/api/account/register/',
data: data,
headers:{
"Content-Type":"application/x-www-form-urlencoded; boundary:XXboundaryXX"
}
})
.then((response) => {
console.log('bitchhh');
})
.catch((response) => {
//handle error
console.log(response);
});
}
[
]