Open adamwathan opened 8 years ago
Im sorry, not yet. I will keep this in mind for a future version.
@adamwathan Have you tried https://github.com/mzabriskie/axios ? The API looks similar to vue-resource
@sqal Did end up finding that and am using it happily, would say it's ok to close this, axios seems great for my use case 👍🏻
Why not use the Fetch API from HTML5??
@kristianmandrup Requires a polyfill since the browsers support is quite there yet, and has some API decisions I really hate.
The main one is that they provide no way to make a GET request and specify the query parameters in a structured way, like Axios does:
axios.get('/user', {
params: {
ID: 12345
}
})
With Fetch, you need to build the query string yourself, which means worrying about escaping data or pulling in another library to do it. Whole thing is a complete pain in the ass compared to something like Axios, which just has a awesome and usable API right out of the box.
Good to know thanks. I agree regarding a more intuitive developer oriented API ;) Perhaps the API though could optionally be made to wrap the native Fetch API if present in the browser and fallback to good old XMLHttpRequest if not?
Is there any way to use just vue-resource in a project only to take advantage of the HTTP client? It's by far the nicest API I've worked with when it comes to making AJAX requests and seems pretty lightweight.
My use case is working on a little non-UI related library that needs to make a couple AJAX calls, and shockingly the best thing out there it seems is
fetch
, which is awful! :) Would love if it was possible to import just the HTTP module from vue-resource and use that instead.