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:
@@ -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();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user