JQuery Rest Client Library

Source: Internet
Author: User

JQuery Rest

https://github.com/jpillora/jquery.rest/

Summary

A JQuery plugin for easy consumption of RESTful APIs

Downloads
  • Development Version
  • Production Version

File Size Report

Original: 10314 bytes.Minified: 5920 bytes.Gzipped:  1376 bytes.
Features
  • Simple
  • Uses jQuery Deferred for asynchonous chaining
  • Basic Auth Support
  • Helpful Error Messages
  • Memory Cache
  • Cross-domain requests with Xdomain

Demobasic Usage
    1. Create a client.
    2. Construct your API.
    3. Make requests.

First setup your page:

<!--JQuery--><ScriptSrc="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script><!--jQuery rest --><script src=" http://jpillora.com/ Jquery.rest/dist/1/jquery.rest.min.js"></script><!--warning:i advise not using the this link, Instead download and host this library on your own server as GitHub have download limits-->< script>
                       
                         > //Examples go here ... </script>    
                                 

Hello Jquery.rest

var client=New $. Restclient ('/rest/api/');  Client. Add (' foo');  Client. foo. read (); //get/rest/api/foo/client.  Foo. Read (a);  get/rest/api/foo/42/client.  Foo. Read (' Forty-two');  get/rest/api/foo/forty-two/             

Retrieving Results (Uses jQuery ' s $. Deferred)

var client=New$. Restclient ('/rest/api/‘);Client.Add' Foo‘);var request=client. foo. read (); //get/rest/api/foo/request. Done (function (data, textstatus, xhrobject) {alert ( ' I have data:  ' + data);}); //OR simply:client. Foo. read (). done (function (data) {alert ( Span class= "pl-s" > "I have data:  ' + data);    

For more features and examples, see:

https://github.com/jpillora/jquery.rest/

JQuery Rest Client Library

Related Article

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.