i need set custom http 'user-agent
header when i'm rendering index.html
page in express.js app.
this doesn't help:
req.headers['user-agent'] = 'myheader';
is possible?
the user-agent header sent http client(browser) , meant read server, e.g., content negotiation. cannot set request header in response, can read. moreover, req object(incomingmessage) passed createserver()
callback readable
stream.
however, request can initiated customer header using:
var headers = {'user-agent': 'ryan dahl'}; http.request({hostname: 'nodejs.org', headers: headers}, function(res) { });
Comments
Post a Comment