DEV Community

Discussion on: Axios or Fetch?- in 2 minutes

Collapse
 
kosich profile image
Kostia Palchyk • Edited

Nice and quick overview, Ash! And just in time, thanks!

--

I wanted to learn more about fetch promise failing reasoning after your post. To share, heres a quote from MDN fetch:

The Promise returned from fetch() won’t reject on HTTP error status even if the response is an HTTP 404 or 500. Instead, it will resolve normally (with ok status set to false), and it will only reject on network failure or if anything prevented the request from completing.

So, "bad news" is still "news" in fetch implementation.

--

UPD: also, axios and fetch have different cancellation API.