vendredi 8 décembre 2017

Using Rest Client in Ember JS without ajax call

I am actually new to ember js.I have a requirement such that i have to invoke a external service using post and get the json data.And i should be doing it like how we do in java to invoke the sevices using restclient.I am not supposed to make an ajax call for that.I was able to find some document which states we can use DS.RESTAdaptor.The sample code snippet is as below

import DS from 'ember-data';

export default DS.RESTAdapter.extend({
    host: 'https://api.example.com'
});

So I am able to figure out some way i can utilize it.But still i am not able to figure out how i can send my JSON Data in POST method and also how to get the response.Can anyone help me out how to do it in ember without using a ajax call.




Aucun commentaire:

Enregistrer un commentaire