I currently work with node.js and express.js. For my current project i need to access the raw strings of the HTTP headers (charset and accpeted).
There is a function in express.js which returns those charsets and accepted headers, however, these are sorted by quality and therefore not useable for me in this special case i need.
req.accepted // Returns sorted array of accepted header
req.acceptedCharsets // Returns sorted array of accepted lang header
However, I need the raw strings (iso-8859-5;q=.2, unicode-1-1;q=0.8, text/*;q=.5, application/json).
Now is there a way how i can access those raw strings in my express app?
Best regards, Crispin
req.headers
as in
var express = require('express');
var app = express.createServer();
app.get('/', function(req, res){
console.log(req.headers);
res.header('time', 12345);
res.send('Hello World');
});
app.listen(3000);