DEV Community

Discussion on: Do you use Axios or Fetch?

Collapse
 
tbhaxor profile image
Gurkirat Singh

Well the question should be "Do you use fetch or xhr?"

So if your platform has to only deal with plain text related requests with promise support, I would recommend and myself use fetch.

But everyone know that's not the case, in every web platform there is a case we have to integrate ajax and stream uploads and downloads. The fetch here fails to implement the logic. So here I would recommend and use ajax.

Now there are too many libraries implementing ajax under the hood, two of them are the most popular one. Jquery and Axios.

When you want to promises and easily maintainable code, I would prefer Axios and Jquery otherwise.