I have some code to send https request in vue.js and when use actions methods in vuex for send https request I get this error in console
GET https://loca
axios
performing a GET
request, you should send data in url
axios.get('/user?ID=12345')
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.finally(function () {
// always executed
})
and performing a POST
request
axios.post('/user', {
firstName: 'Fred',
lastName: 'Flintstone'
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
now in your code you send POST request and this have object to send, you shod use
Axios.post('https://localhost:443/api/getpeople',{ withCredentials:
true}).then(response=>response.data).then(result=>{
commit('setPeople',result);
}).catch(error=>{
console.log(error.response)
for GET request
Axios.get('https://localhost:443/api/getpeople').then(response=>response.data).then(result=>{
commit('setPeople',result);
}).catch(error=>{
console.log(error.response)