admin管理员组文章数量:1356277
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 .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.
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./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.
Share Improve this question edited Aug 25, 2016 at 16:24 philip_nunoo asked Aug 25, 2016 at 12:20 philip_nunoophilip_nunoo 9384 gold badges10 silver badges22 bronze badges 1- I am facing the same problem. Were you able to find a solution to this ? – Pratik Singhal Commented Nov 10, 2017 at 14:19
1 Answer
Reset to default 7use
response.headers
instead of
response.header
本文标签: javascriptGetting Response Headers with node request moduleStack Overflow
版权声明:本文标题:javascript - Getting Response Headers with node request module - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743963264a2569420.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论