Vue Http.get Vue-resource

Source: Internet
Author: User

// use HTTP based on global Vue object Vue.http.get ('/someurl ', [options]). Then (Successcallback, Errorcallback); Vue.http.post ('/someurl ', [body], [options]). Then (Successcallback, Errorcallback);
// using $http within a Vue instance this. $http. Get ('/someurl ', [options]). Then (Successcallback, errorcallback); this. $http. Post ('/someurl ', [body], [options]). Then (Successcallback, Errorcallback);
// Traditional notation this. $http. Get ('/someurl ', [options]). Then (function(response) {    //  Response succeeded Callback function(response) {    //  response error callback });
supported HTTP methods vue-resource's request API is designed in restful style, it provides 7 requests for api:get (URL, [options]) head (URL, [options])  Delete(URL, [options]) Jsonp (URL, [options])post (URL, [body], [options]) put (URL, [body], [ Options]) patch (URL, [body], [options])

More

Http://www.cnblogs.com/axl234/p/5899137.html

Vue Http.get Vue-resource

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.