API需要指定api版本application/vnd.api+json;version=1,还需要安全的 x-app-id 和 x-app-secret。有没有办法在 Ember 的 RESTAdapter 中指定它?
尝试请求标头后
App.Adapter = DS.RESTAdapter.extend({
  namespace: 'api',
  beforeSend: function(xhr) {
    xhr.setRequestHeader('x-my-custom-header', 'some value');
  }
})
解决方案
App.Adapter = DS.RESTAdapter.extend({
  bulkCommit: true,
  namespace: 'api',
  headers: { 
   'Accept': 'application/vnd.app+json;version=1',
   'x-appid': '2375498237',
   'x-secret': '238945298235236236236236375923'
  },
  ajax: function(url, type, hash) {
    if (this.headers !== undefined) {
      var headers = this.headers;
      hash.beforeSend = function (xhr) {
        Ember.keys(headers).forEach(function(key) {
          xhr.setRequestHeader(key, headers[key]);
        });
      };
    }
    return this._super(url, type, hash);
  }
});
App.Store = DS.Store.extend({ adapter: App.Adapter.create() }); 
App.Store = App.Store.create();
更新#2
不再需要上述解决方案,因为 Ember 现在默认支持此行为。您只需提供headers,它会自动添加。
在此处查看文档http://emberjs.com/guides/models/connecting-to-an-http-server/#toc_custom-http-headers