+0
日增长
9,965
stars
1,559
forks
2
watchers
142
prs
536
issues
53
releases
README
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.
html
Example
js
{
// GET /someUrl
this.$http.get('/someUrl').then(response = {
// get body data
this.someData = response.body;
}, response = {
// error callback
});
}
Documentation
- Configuration
- HTTP Requests/Response
- Creating Resources
- Code Recipes
- API Reference
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
MITTop issues
#572IE9 Can't set headers,So Server can't parse post data13 comments · 2017-03-03#407How can i remove the added [] from POST array data?13 comments · 2016-09-18#663Unable to see extra headers from response9 comments · 2017-11-26#652GET call failing - Access-Control-Allow-Origin9 comments · 2017-09-12#600handling in case of status code 2048 comments · 2017-05-02#696Impossible to change Vue.http.headers.common['Authorization']7 comments · 2018-05-25#686Why change my POST method to OPTIONS?7 comments · 2018-04-02#741Setting root does not take effect6 comments · 2020-04-13
Latest release
1.5.3 1.5.3 2021-06-14Changed - Use got version =8.0 <12.0