Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting response headers information on done callback #521

Closed
zanona opened this issue Oct 19, 2012 · 3 comments
Closed

getting response headers information on done callback #521

zanona opened this issue Oct 19, 2012 · 3 comments

Comments

@zanona
Copy link

zanona commented Oct 19, 2012

Hello,
Is it somehow possible to get the response headers provided with the done callback, like:

done: function (errors, window, response) {
     console.log(response.headers.statusCode);
}

perhaps using the same response provided by the request module?

@domenic
Copy link
Member

domenic commented Oct 19, 2012

Couldn't you just request the page yourself, then pass in the HTML to jsdom?

@zanona
Copy link
Author

zanona commented Oct 19, 2012

Well jsdom offers this convenience, so I would like to do it all from there, if possible.
In addition, by loading it separately I won't get window.location attributes, etc. which in my case is essential.

@domenic
Copy link
Member

domenic commented Oct 19, 2012

This is too much for the convenience method. If you need window.location to be set correctly, use the url parameter of the config (see #470).

@domenic domenic closed this as completed Oct 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants