亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

提交結果404是哪里寫錯?

$?node?comment
Status:?404
headers:?{"date":"Fri,?16?Jun?2017?13:24:44?GMT","server":"Apache","content-leng
th":"207","keep-alive":"timeout=5,?max=100","connection":"Keep-Alive","content-t
ype":"text/html;?charset=iso-8859-1"}
true
object
評論完畢!

代碼如下:

var?http?=?require('http')
var?querystring?=?require('querystring')

var?postData?=?querystring.stringify({
'content':?'abcdefgh',
'mid':?8837
})

var?options?=?{
hostname:?'www.mooc.com',
port:?80,
path:?'/course/docomment',
method:?'POST',
headers:?{
'Accept':'application/json,?text/javascript,?*/*;?q=0.01',
'Accept-Encoding':'gzip,?deflate',
'Accept-Language':'zh-CN,zh;q=0.8',
'Cache-Control':'no-cache',
'Connection':'keep-alive',
'Content-Length':postData.length,
'Content-Type':'application/x-www-form-urlencoded;?charset=UTF-8',
'Cookie':'imooc_uuid=f76b92a8-ebc3-4fd5-b076-7d400f63f572;?imooc_isnew_ct=1490499978;?loginstate=1;?apsid=kzZTM1ODUxNzQwMTRhMWVmMWI3MzQ1ZTdjNWM2YzcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANTIyMTEwOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADlmMTUzYTQ4NmZiMjA2NjQ4MWVjNzM4Mjc0YTY0YjI0Yh89WWIfPVk%3DND;?PHPSESSID=lg7c6rqna2thgs8bffarns6g00;?IMCDNS=0;?Hm_lvt_f0cfcccd7b1393990c78efdeebff3968=1497580726,1497596581,1497596615,1497615629;?Hm_lpvt_f0cfcccd7b1393990c78efdeebff3968=1497615876;?imooc_isnew=2;?cvde=5943cd12c5f9b-19',
'Host':'www.xianlaiwan.cn',
'Origin':'http://www.xianlaiwan.cn',
'Pragma':'no-cache',
'Referer':'http://www.xianlaiwan.cn/video/8837',
'User-Agent':'Mozilla/5.0?(Windows?NT?10.0;?Win64;?x64)?AppleWebKit/537.36?(KHTML,?like?Gecko)?Chrome/61.0.3128.2?Safari/537.36',
'X-Requested-With':'XMLHttpRequest'
}
}

var?req?=?http.request(options,function(res)?{
console.log('Status:?'?+?res.statusCode)
console.log('headers:?'?+?JSON.stringify(res.headers))

res.on('data',function(chunk)?{
console.log(Buffer.isBuffer(chunk))
console.log(typeof?chunk)
})
res.on('end',function()?{
console.log('評論完畢!')
})
})

req.on('error',function(e)?{
console.log('Error:?'?+?e.message)
})

req.write(postData)
req.end()


正在回答

1 回答

哎呀是我自己吧網址記錯了,慚愧慚愧!

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
進擊Node.js基礎(一)
  • 參與學習       219329    人
  • 解答問題       982    個

本視頻教程帶你揭開Node.js的面紗,帶你走進一個全新世界

進入課程

提交結果404是哪里寫錯?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號