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

Get Status line from a response #2591

Closed
miketran78727 opened this issue Mar 9, 2017 · 2 comments
Closed

Get Status line from a response #2591

miketran78727 opened this issue Mar 9, 2017 · 2 comments
Labels

Comments

@miketran78727
Copy link

miketran78727 commented Mar 9, 2017

Is there a way to get the status line from response? In Java, I can use https://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/StatusLine.html to get HTTP-Version, Status-Code and Reason-Phrase. I do not see status line in Request's response object.

@wotgl
Copy link

wotgl commented Mar 13, 2017

@miketran78727 hi!
try this

let callback = function(error, response, body) {
  console.log(response.statusCode, response.statusMessage, response.httpVersion);
}
request(options, callback);

@stale
Copy link

stale bot commented Nov 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 23, 2018
@stale stale bot closed this as completed Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants