Adding headers after RESTAdapter initialization

前端 未结 3 513
隐瞒了意图╮
隐瞒了意图╮ 2021-01-13 22:53

I am trying to add an Authorization header to my adapter\'s request after the adapter has been initialized and used. I can add headers in a static way at the t

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-13 23:04

    The answers are already introduced in official API document.

    http://emberjs.com/api/data/classes/DS.RESTAdapter.html#toc_headers-customization

    • Use computed property with session injection
    • or just use volatile computed property

提交回复
热议问题