Vue-resource vs Axios?

Most of us think vue-resource is deprecated to use as Vue has removed it's recommended ajax request. But in fact, it is not. Vue has only rollback the github to PageKit team as there are obvious library to handle the ajax requests.

So, it's up to us to use any of the available library. But choosing one of them is really hard.

Thus, can anyone please provide a detailed differences between vue-resource vs axios vs fetch api?

Comments (4)

Francis's photo

I am really so much happy to use your vue resources vs axios nodes. The comments they have been shared with https://awriter.org/hirewriters-com-review/ this blog about their online services. So, We all been happy to chose the basic values and resources for us.

winkler glinesnw's photo

This exercise will enhance your golf swing speed and enable you to save and release energy. It improves your game by providing power and strength to your torso and hips. While playing golf it also enhances your recoil action. It strengthens your rotational power Click Here For More Information .

nicolasb's photo

I'm not sure, i haven't follow this story in the last few month.

But they have deprecated vue-resource because the library cannot be used with server-side rendering and axios offer this possibility.

If you don't want to use server-side rendering on your app, vue-resource can be efficient. Else maybe not, you will need axios

If it can help you ! :)

J03's photo

Not exactly sure about the differences, but the fetch API seems simple and straight forward, sufficient for most requests, no?

let url = 'example.com'

fetch (url)
.then (res => res.json ())
.then (doSomethingWithJSON)
.catch (err => console.log (err))

or

let url     = 'example.com'
let headers = new Headers ()
let init    = {
  method:  'GET',
  headers: headers,
  mode:    'cors',
  cache:   'default',
}
fetch (url, init)
.then (res  => res.json ())
.then (doSomethingWithJSON)

Looking briefly at Axios and vue-resource, they both seem identical to the fetch API, so most likely no point in bothering with them unless you get a project that already uses them. I imagine they were created before the fetch API was standardized? Just a guess though. When in doubt, I use the simplest and more likely to be available API.

Other thing to consider is that you don't have to worry about using extra bandwidth if you use the Fetch API, as it's already included in browsers. Worst case scenario is you include a polyfill or transpile it with babel.