What's the diff between fetch and xhr type? Which one should I use? or Can someone explain the diff b

16 Replies, 1242 Views

Kinda surprised no one’s mentioned streaming yet!

XHR can’t do streaming responses natively, but fetch can with `response.body`. That’s a game-changer for real-time stuff.

Downside? fetch’s error handling is *trash*. Miss a 500? Tough luck unless you write extra checks.

XHR’s `onerror` is simpler for sure.

Messages In This Thread



Users browsing this thread: 1 Guest(s)