nodejs -- 自定義頭部信息


var http=require('http');
http.createServer(function(req,res){
    console.log(req.headers);
    res.writeHead(200,{
        'content-Type':'text/plain',
        'aaaa':'wo'  //自定義頭部信息
    });
    res.end("bbbbbbbbb");
}).listen(8888,'127.0.0.1');
console.log('server running at localhost:8888 ');


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章