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

18 Replies, 606 Views

"Can someone explain the diff between fetch and xhr type in plain terms?"

hey folks, been using both fetch and xhr type for API calls but still kinda fuzzy on the *main* diff between them.

fetch is newer, promise-based, and way cleaner syntax imo. xhr type feels older, more verbose with all those callbacks.

but like, is there a *real* advantage to one over the other? or is it just preference?

also, heard fetch doesn’t handle errors as smoothly? true or nah?

would love some clarity on the diff between fetch and xhr type—thanks!

(ps: if this has been asked before, my bad—link me!)

Messages In This Thread
What's the key diff between fetch and xhr type for API requests? or Can someone explain the diff betw - by - 15-12-2024, 01:55 PM



Users browsing this thread: 1 Guest(s)