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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

返回200,但是評論卻沒有看見新增,求解

返回200,但是評論卻沒有看見新增,求解

慕神1332585 2016-03-16 15:52:27
var http = require('http');var querystring = require('querystring');//把對象序列化var postData = querystring.stringify({ 'content':'12345', 'cid':348});var options = { hostname:'www.xianlaiwan.cn', port:80, path:'/course/docomment', meth:'POST', headers:{ 'Accept':'application/json, text/javascript, */*; q=0.01',? ? ? ? 'Accept-Encoding':'gzip, deflate',? ? ? ? 'Accept-Language':'zh-CN,zh;q=0.8',? ? ? ? 'Connection':'keep-alive',? ? ? ? 'Content-Length':postData.length,? ? ? ? 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8',? ? ? ? 'Cookie':'imooc_uuid=f81665e5-11b0-41eb-9a31-07a5bb5a41e0;imooc_isnew_ct=1457316482;IMCDNS=0;loginstate=1;apsid=gzNTc0NzdjMGM1NGU4N2JkNDE5MWJlNTY0MTkzYjMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjczMzgyMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAxMjU5MDMxMDFAcXEuY29tAAAAAAAAAAAAAAAAAAAAADFiODUxNzgyZjg3YmI4Y2ZiNGY2OGNlYjExNmVlNmZln%2BLcVp%2Fi3FY%3DZj;last_login_username=125903101%40qq.com;bdshare_firstime=1457935399282;PHPSESSID=mmgrt2fjfdr85k7pfigdjha856;jwplayer.qualityLabel=è???;jwplayer.mute=false;jwplayer.volume=100;imooc_isnew=2;cvde=56e8abaf0b785-76;Hm_lvt_f0cfcccd7b1393990c78efdeebff3968=1457915837,1457935981,1458001811,1458088818;Hm_lpvt_f0cfcccd7b1393990c78efdeebff3968=1458111895',? ? ? ? 'DNT':'1',? ? ? ? 'Host':'www.xianlaiwan.cn',? ? ? ? 'Origin':'http://www.xianlaiwan.cn',? ? ? ? 'Referer':'http://www.xianlaiwan.cn/comment/348',? ? ? ? 'User-Agent':'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) ? ? ? ? Chrome/48.0.2564.97 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 回答

?
慕用0418482

TA貢獻98條經驗 獲得超15個贊

返回200代表請求成功,還要看有沒有返回值

查看完整回答
反對 回復 2016-08-02
  • 1 回答
  • 0 關注
  • 1459 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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