I have JavaScript at Front:
var mix = {
methods: {
signIn () {
const username = document.querySelector('#login').value
const password = document.querySelector('#password').value
var dict = {}
dict['username']=username
this.postData('/api/sign-in/', JSON.stringify(dict))
.then(({ data, status }) => {
location.assign(`/`)
})
.catch(() => {
alert('Error auth')
})
}
},
mounted() {
},
data() {
return {}
}
}
And when I send POST query like
{"username": "aa"}
I receive dict like:
{'{"username":"aa"}': ''}
As you can see value is empty, all data set as key. What can be a problem?
Thx.