I use token authentication to communicate between React and DRF. I can make GET request using below token but can not POST data to server with payload.
axios.post('URL',
{
headers: {'Authorization': 'Token 83d1892877db7950c1c5a818cbb6ca738e53f90b'}
})
.then(function (response) {
console.log(response)
})
.catch(function (error) {
console.log(error);
})
I get error 500 from Django server when posting above.But with same URL and Token I could successfully execute POST request in Postman.
I want to add a data with the axios POST request, the data is {name:'myname'}.
Thanks in advance