I'm trying to retrieve the server response header for a request from a server.
import 'request' from 'request'
var url = "SOME_URL"
var options = { url: url };
var callback = function(error, response, body) {
if(!error){
console.log(response); // <==
}
}
request(options, callback)
Going through the "response" object it doesn't look like it contains the Server response-header http://www.tutorialspoint.com/http/http_header_fields.htm
The only header being returned after doing this
console.log(response.headers)
is from the client request header.
Can anyone point in towards the right direction in order to access this object.
use
response.headers
instead of
response.header
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With