http.get('url',function(res){
var html = ''
res.on('data',function(chunk){
html += chunk
})
res.on('end',function(){
console.log(html)
})
})
//這樣寫好像并不行
const options = {
url:'xxxx'
a:'asdsaf',
fsa:'asioduioasd'}
http.get(options,function(res){...
})我想給url地址發送帶特定請求頭的請求,請問,如何在這個里面設置請求頭呢?
- 1 回答
- 0 關注
- 1645 瀏覽
添加回答
舉報
0/150
提交
取消