Answer the question
In order to leave comments, you need to log in
Why do I get an empty object from a request as a public API?
I'm writing a request to the public API - https://frontend-test-case.azurewebsites.net/swagg...
and I get an empty object, I don't understand why, maybe I'm passing the parameters incorrectly, please tell me.
Here is the request itself in vuex:
mutations: {
getData(state, list){
state.list = list
console.log(state.list)
}
},
actions:{
list(context) {
if (context.search != '') {
HTTP.post(Routes.getList, {
params: {
"period": 0,
"date": "2019-03-05T15:12:13.319Z"
}
})
.then(data => {
context.commit('getData', data)
})
.catch(error => {
console.log(error);
});
}
},
}
})
import axios from 'axios'
export const HTTP = axios.create({
baseURL: 'https://frontend-test-case.azurewebsites.net',
timeout: 10000
})
export const Routes = {
getList: '/api/report/card',
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question