Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 20, 2014 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/fb89828b0c9f947e46b8 to your computer and use it in GitHub Desktop.
Save devdays/fb89828b0c9f947e46b8 to your computer and use it in GitHub Desktop.
Single Page App - REST Requests using Amplify
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