jsonplaceholder
jsonplaceholder copied to clipboard
Similar Issue to earlier this month, the CORS policy does not return a simple get request via axios api
Hi, I'm following a basic tutorial on Brad Traversy's youtube channel using vuex, but where I call an axios request to the todos db with a limit parameter I get this error message:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://jsonplaceholder/typicode.com/todos?_limit=20. (Reason: CORS request did not succeed).
The axios call in particular is here:
`` async filterTodos({ commit }, e) { const limit = parseInt(e.target.options[e.target.options.selectedIndex].innerText);
const response = await axios.get(`https://jsonplaceholder/typicode.com/todos?_limit=${limit}`);
commit("setTodos", response.data);
}
It could be because I'm new to coding, but from what I've gathered a similar issue was brought up earlier this month, so I thought I'd put this forward.