ember-cli-mirage
ember-cli-mirage copied to clipboard
# Is it possible to use header keys in mirage ?
I am building an ember app and i want to include some additional keys in request header
. Is it possible to access these keys from ember-cli-mirage. Since mirage is intercepting and not making any request, i think it wont be possible. Is it ??
Do you mean you want Mirage to respond to your Ember app with additional headers, in the response? Or you want your Ember app to add additional keys in the headers of the request it makes?
@samselikoff No I am adding headers in my request and i want to get these headers inside mirage.
this.get('/unitOfMeasures/:name', function (schema, request) {
let uom = schema.unitOfMeasures.findBy('name', request.params.name);
return uom;
});
In the above request.requestHeaders
is a hash that has the headers you are looking for. I see the Authorization
header when I put a breakpoint in my tests.