2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

Using response headers

This commit is contained in:
Matt Zabriskie
2014-08-27 03:12:29 -06:00
parent 514e281a1b
commit c0a9184739
7 changed files with 391 additions and 157 deletions
+19
View File
@@ -0,0 +1,19 @@
var parseHeaders = require('../../lib/parseHeaders');
module.exports = {
testParse: function (test) {
var date = new Date();
var parsed = parseHeaders(
'Date: ' + date.toISOString() + '\n' +
'Content-Type: application/json\n' +
'Connection: keep-alive\n' +
'Transfer-Encoding: chunked'
);
test.equals(parsed['date'], date.toISOString());
test.equals(parsed['content-type'], 'application/json');
test.equals(parsed['connection'], 'keep-alive');
test.equals(parsed['transfer-encoding'], 'chunked');
test.done();
}
};