Created
December 20, 2014 00:39
-
-
Save devdays/fb89828b0c9f947e46b8 to your computer and use it in GitHub Desktop.
Single Page App - REST Requests using Amplify
This file contains 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
amplify.request.define( "ajaxRESTFulExample", "ajax", { | |
url: "/myRestFulApi/{type}/{id}", | |
type: "GET" | |
}) | |
// later in code | |
amplify.request( "ajaxRESTFulExample", | |
{ | |
type: "foo", | |
id: "bar" | |
}, | |
function( data ) { | |
// /myRESTFulApi/foo/bar was the URL used | |
data.foo; // bar | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment