vue-resource README

The project's README from github.com/pagekit/vue-resource. As one markdown file: README.md.

vue-resource Build Downloads jsdelivr Version License

The plugin for Vue.js provides services for making web requests and handle responses using a XMLHttpRequest or JSONP.

Features

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

MIT

vue-resource (pagekit/vue-resource)

Searching Database…

10K ·GitHub
archived
What is this?vue-resource is the HTTP client plugin for Vue.js: it adds services for making web requests over XMLHttpRequest or JSONP and handling the responses inside a Vue app.
Is it a standalone HTTP client or a plugin I add to my Vue app?A plugin for Vue.js — you register it inside an existing Vue project rather than using it on its own. It is a compact 14KB library (5.3KB gzipped).
How do I add it to my project?Install it with yarn or npm, or skip the bundler and include it from a CDN — it is published on jsdelivr, unpkg and cdnjs.
Which versions of Vue does it work with?Only Vue itself is required: the plugin supports Vue 1.0 and Vue 2.0, and was never extended to Vue 3.
Is it still a good pick for a new project?No — the repository is archived, so the project is deprecated and receives no further updates. It is only an option for existing Vue 1.x/2.x codebases.
Which browsers can it run in?It runs in the browser: latest Firefox, Chrome, Safari and Opera, plus IE9 and newer.
What features does it offer beyond plain requests?Requests work with the Promise API, URLs can be built with URI Templates, and you can attach interceptors to process requests and responses on the way through.
Can I use it in commercial projects?Yes — vue-resource is MIT-licensed, so it is free to use, modify and ship, including in commercial applications.
My Vue 2 app already uses it — should I remove it?No need — existing apps keep working, but the archived repo means no new releases, fixes or security updates, so it is a dead end long term.
What are similar projects?q, fetch, vue-router, material, Respond, superagent, codemirror5, vuex
Creator
pagekit
Size
1.7 MB
Stars
10K
Age
12y
Commits · 90 Days