dimanche 25 janvier 2015

Retrieve data from non-default REST API

I would like to query my server for this URL http://localhost:1337/api/posts/count?category=technology using Ember. I'm using the default RESTAdapter like this:



export default DS.RESTAdapter.extend({
coalesceFindRequests: true,
namespace: 'api',
)};


The Post model looks like this:



import DS from 'ember-data';

var Post = DS.Model.extend({
title: DS.attr('string'),
permalink: DS.attr('string'),
body: DS.attr('string')
});

export default Post;


How do I make such a request?





Aucun commentaire:

Enregistrer un commentaire