DEV Community

Discussion on: Consume RESTful APIs with fetch in Vue

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

Just be aware that fetch is not status code aware. Instead, it will throw errors if strings cannot be deserialized as json.

Collapse
 
xinnks profile image
James Sinkala

I'm aware, just as noted on the differences with jQuery.ajax() on the mozzila page - "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)", Thanks for the reminder, maybe I should add a bit on that to the post.