vue-resource
vue-resource
The plugin for Vue.js provides services for making web requests and handle responses using a XMLHttpRequest or JSONP.
Features
- Supports the Promise API and URI Templates
- Supports interceptors for request and response
- Supports latest Firefox, Chrome, Safari, Opera and IE9+
- Supports Vue 1.0 & Vue 2.0
- Compact size 14KB (5.3KB gzipped)
Installation
You can install it via yarn or NPM.
$ yarn add vue-resource
$ npm install vue-resource
CDN
Available on jsdelivr, unpkg or cdnjs.
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
Example
{
// GET /someUrl
this.$http.get('/someUrl').then(response => {
// get body data
this.someData = response.body;
}, response => {
// error callback
});
}
Documentation
Changelog
Details changes for each release are documented in the release notes.
Contribution
If you find a bug or want to contribute to the code or documentation, you can help by submitting an issue or a pull request.
License
Dependencies
Dependencies
@babel/core: ^7.2.2@babel/preset-env: ^7.2.0babel-loader: ^8.0.4eslint: ^5.11.1generate-release: ^1.1.1jasmine: ^3.3.1jasmine-core: ^3.3.0jest: ^23.6.0karma: ^3.1.4karma-chrome-launcher: ^2.2.0karma-firefox-launcher: ^1.1.0karma-jasmine: ^2.0.1karma-safari-launcher: ^1.0.0karma-webpack: ^3.0.5replace-in-file: ^3.4.2rollup: ^0.66.0rollup-plugin-babel: ^4.1.0rollup-plugin-replace: ^2.1.0uglify-js: ^3.4.9vue: ^2.5.21webpack: ^4.28.3webpack-cli: ^3.1.2