REST Webservice is a jQuery plugin that allows you to easily send get, post, put and delete requests to a REST API.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
rest-webservice
GPL-License.txt
MIT-License.txt
README.md

README.md

REST Webservice

REST Webservice is a jQuery plugin that allows you to easily send get, post, put and delete requests to a REST API.

Download

[Download REST Webservice] (https://github.com/adrazich/rest-webservice-jquery/downloads)

How to Use

###Javascript

<script type="text/javascript">
  $(document).ready(function(){
	
	// Send a GET request to get a user
    $.webservice('get', '/user/adrazich', '', function(data){
	  // there is a callback function you can use to get your data back
	  console.log(data);
	  
	  // data should be in JSON format, because it's super easy to use, like so...
	  console.log(data.message);
	});
  
	// update a user sending a PUT request
	$.webservice('put', '/user', { id: 'adrazich', name: 'Anna Drazich' }, function(data){
	  console.log(data);
	});
	
  });
</script>

###Required Files

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="rest-webservice/jquery.rest-webservice.js" type="text/javascript"></script>

Browser Support

Internet Explorer 7+, Firefox, Chrome, Safari

License

Copyright (c) 2012 Anna Drazich

Dual licensed under the [MIT] (https://github.com/adrazich/rest-webservice-jquery/blob/master/MIT-License.txt) and [GPL] (https://github.com/adrazich/rest-webservice-jquery/blob/master/GPL-License.txt) licenses.

###More information about these licenses