Skip to content

Instantly share code, notes, and snippets.

@TheRightChoyce
Created April 3, 2012 04:02
Show Gist options
  • Select an option

  • Save TheRightChoyce/2289213 to your computer and use it in GitHub Desktop.

Select an option

Save TheRightChoyce/2289213 to your computer and use it in GitHub Desktop.
Debating on which syntax is friendlier for my jsRestAPI (assuming jquery)
$.api.connect('http://localhost/jsRestApiWrapper/api/csharp', {/* options */ } );
$.api('/person/create/', {
model: {FirstName: 'test', LastName: 'test', Email: '[email protected]'}
, success: function(data) { /* do something */ }
});
$.api('/person/get/', {
success: function(data) { /* do something */ }
});
$.api('/person/next/', {
success: function(data) { /* do something */ }
});
$.api('/person/get/', {
id: 1
, success: function(data) { /* do something */ }
});
$.api('/person/update/', {
id: 1
, model: {FirstName: 'test1', LastName: 'test', Email: '[email protected]'}
, success: function(data) { /* do something */ }
});
$.api('/person/delete/', {
id: 1
, success: function(data) { /* do something */ }
});
$.api.connect('http://localhost/jsRestApiWrapper/api/csharp', { /* options */ } );
$.api.create({
controller: 'person'
, model: {FirstName: 'test', LastName: 'test', Email: '[email protected]'}
, success: function(data) { /* do something */ }
});
$.api.get({
controller: 'person'
, success: function(data) { /* do something */ }
});
$.api.next({
controller: 'person'
, success: function(data) { /* do something */ }
});
$.api.get({
controller: 'person'
, id: 1
, success: function(data) { /* do something */ }
});
$.api.update({
controller: 'person'
, id: 1
, model: {FirstName: 'test1', LastName: 'test', Email: '[email protected]'}
, success: function(data) { /* do something */ }
});
$.api.delete({
controller: 'person'
, id: 1
, success: function(data) { /* do something */ }
});
$.api.connect('http://localhost/jsRestApiWrapper/api/csharp', { /* options */ } );
$.api.create('person', {
model: {FirstName: 'test', LastName: 'test', Email: '[email protected]'}
, success: function(data) { /* do something */ }
});
$.api.get('person', {
success: function(data) { /* do something */ }
});
$.api.next('person', {
success: function(data) { /* do something */ }
});
$.api.get('person', {
id: 1
, success: function(data) { /* do something */ }
});
$.api.update('person', {
id: 1
, model: {FirstName: 'test1', LastName: 'test', Email: '[email protected]'}
, success: function(data) { /* do something */ }
});
$.api.delete('person', {
id: 1
, success: function(data) { /* do something */ }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment