XMLHttpRequest (XHR) Vs Fetch API

cross-posted from: programming.dev/post/13268260

Hi,

I discovered this webpage
developer.mozilla.org/en-US/…/XMLHttpRequest

Where it say

The Fetch API is the modern replacement for XMLHttpRequest.

Without further explain on why so…

Did you (yourself) migrated from XHR to The Fetch API ? and is it better ? or do you know any (not bias) article about it ?

What about performances etc…

Thanks

trxxruraxvr,

I did, just being able to use promises is already worth it. Performance mostly depends on the server you’re calling so I didn’t really look at that. Fetch is just a lot more user friendly.

victorz,

A very big step up in developer experience, indeed.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • webdev@lemmy.world
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines