What's the key diff between fetch and xhr type for API requests? or Can someone explain the diff betw

18 Replies, 916 Views

Wow, thanks everyone! This really clears up the diff between fetch and xhr type for me.

Didn’t realize fetch doesn’t auto-handle HTTP errors—that explains some weird bugs I’ve had. Gonna start checking `response.ok` now.

Also, good point about XHR’s progress tracking. Might stick with fetch for most stuff but keep XHR in mind for file uploads.

Appreciate the links too—MDN’s fetch docs are a lifesaver.

(ps: anyone got a favorite fetch wrapper lib? heard of axios but not sure if it’s worth it.)

Messages In This Thread



Users browsing this thread: 1 Guest(s)