I'm trying to retrieve an object from an API with axios, but I get the following error:
Uncaught (in promise) Error: Request failed with status code 404
Pasting the same url in the browser gives me the correct view of the object, I don't know where the error is.
Code:
useEffect(() => {
axios
.get("www.themealdb.com/api/json/v1/1/random.php")
.then((res) => console.log(res));
});