ash-framework / roadmap

0 stars 0 forks source link

Headers #33

Closed digitalsadhu closed 7 years ago

digitalsadhu commented 7 years ago

How should the user be able to specify headers?

digitalsadhu commented 7 years ago

Thinking something like:

class MyRoute extends Ash.Route {
  model () {
    this.headers.set('Content-Type', 'application/json')

    // could also this.headers.get('Content-Type')
  }
}

If headers are not explicitly set then we would do our best to work out content type from the content etc.

Thoughts @pnw?

pnw commented 7 years ago

If this.headers is the response headers, how do I access the request headers?

digitalsadhu commented 7 years ago

Hehe yea. That occurred to me after I wrote that and I've been mulling it over ever since On Fri, 11 Nov 2016 at 08:19, Patrick notifications@github.com wrote:

If this.headers is the response headers, how do I access the request headers?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ash-framework/roadmap/issues/33#issuecomment-259896840, or mute the thread https://github.com/notifications/unsubscribe-auth/ABH2Cnf-yHEXPI99VvRT10_itbvMvTl-ks5q9BcEgaJpZM4KuekO .