Vue-resource: Response Headers

Created on 4 Feb 2016  路  8Comments  路  Source: pagekit/vue-resource

Hey,

How can I have access to the response headers?

Most helpful comment

I guess we need a way to access exposed headers. I encountered this problem too, but I had to finish the project, tried something totally different. Still looking for getting the headers tho. It would be great to access them.
@gil0mendes check out this link on the matter. I opened a topic over there.
http://stackoverflow.com/questions/34852118/vue-resource-headers-from-the-cross-origin-response-is-not-fully-available

All 8 comments

The res.headers(), on the interceptors.response, only returns this: Object {content-type: "application/json", cache-control: "no-cache", "": ""} :(

Just pass the name to get just one header, like res.header('content-type')

The server returns an Header named Authorization, but when I call res.header('Authorization') theres nothing there.

The res.header has access to all returns Headers?

Yes, without the name argument it returns all recieved headers.

Not in my case :(

VueResource Response

{content-type: "application/json", cache-control: "no-cache", "": ""}

Received Headers

screen shot 2016-02-05 at 11 19 57

I guess we need a way to access exposed headers. I encountered this problem too, but I had to finish the project, tried something totally different. Still looking for getting the headers tho. It would be great to access them.
@gil0mendes check out this link on the matter. I opened a topic over there.
http://stackoverflow.com/questions/34852118/vue-resource-headers-from-the-cross-origin-response-is-not-fully-available

@easteregg that's it... I need to expose the header on API side.... tks :+1:

There is nothing wrong with this lib :)

@easteregg thanks

Was this page helpful?
0 / 5 - 0 ratings