My code in coffeescript:
resource = $resource GlobalService.apiRoot + "stuffs", {},
get:
method: "GET"
headers:
"Accept": "application/stuffs;version=3"
"Authorization": 'Token token="' + $.cookie('token') + '"'
My javascript code:
var resource;
resource = $resource(GlobalService.apiRoot + "stuffs", {}, {
get: {
method: "GET",
headers: {
"Accept": "application/stuffs;version=3",
"Authorization": 'Token token="' + $.cookie('token') + '"'
}
}
});
Then when I do it.
resource.get ->
It does not send these specified headers and does not actually allow CORS authorization.
Any recommendations?
source
share