【发布时间】:2013-11-15 00:19:17
【问题描述】:
Ember.js(和 Ember-data)中有没有办法将凭据发送到需要 Basic HTTP Authentication 的 api?我可以在 JQuery here 中看到它是如何完成的,但在 Ember 中看不到任何直接的方法。我想也许在标题中添加一些东西会起作用(见下文咖啡脚本),但没有成功:
App.AuthAdapter = DS.RESTAdapter.extend(
host: 'https://my-api.example.com'
namespace: 'v1'
headers:
"Authorization Basic fooUsername:barPassword"
...
【问题讨论】:
标签: ember.js ember-data basic-authentication