Created
April 3, 2012 04:02
-
-
Save TheRightChoyce/2289213 to your computer and use it in GitHub Desktop.
Debating on which syntax is friendlier for my jsRestAPI (assuming jquery)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.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 */ } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.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 */ } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.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