I'm trying to set up a React project and want to get a basic get call working. The url I'm using is https://jsonplaceholder.typicode.com/todos/1
just for testing and to see if everything is working well. However, I get a 404 error back. The call I make is
axios.get('https://jsonplaceholder.typicode.com/todos/1')
.then(response => console.log(response))
.catch(error => console.log(error.response));
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.js"></script>
When I try this call with the Fetch API, I get the correct response but with Axios, I get back this error {status: 404, config: {…}, data: undefined}
. I've been trying to fix this for days and nothing has worked. Is there some type of obvious setup I may have missed?
I followed this tutorial for the most part: https://hackernoon.com/tutorial-how-to-make-http-requests-in-react-part-3-daa6b31b66be
Any help is appreciated :)