How to get 404 status code from fetch in react

Viewed 27

I am tryibg to get the status code of a url.

fetch(https/**********************).then((response) => { console.log(response.status,"STATUS"); // returns 200 });

200 status code is coming. But 404 status code is not coming.

Instead of that CORS error is coming.

How to get 404 status code?

0 Answers
Related