node.js之评论灌水

xiaoxiao2021-02-28  3

内容来源慕课网

let http = require('https') let querystring = require('querystring') let postData = querystring.stringify({ commentid:'', content: '写的可以啊', replyId:'' }) let options = { hostname:'blog.csdn.net', port:'443', path:'/lufy_legend/phoenix/comment/submit?id=12488909', method:'POST', headers:{ 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'zh-CN,zh;q=0.9', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', 'Content-Length': postData.length, 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Cookie': 'uuid_tt_dd=10_37193077600-1524021393910-280393; dc_session_id=10_1524021393910.571563; __yadk_uid=SihnZhg2eBEXvBgC845D53lD3ZtGLdd9; smidV2=2018041811163840b8f71812a3ef1714f5adcb71c9bf53003be3b8aa2642350; UserName=qq_35425276; UserInfo=fQBruFeRvIGBqjv7rwxQSTta3BpOgz976+Kql/adDEU6hUAQDIkR+hz5zfTsWcdU4oioqvV5YBLZhxGtbq3YNw==; UserNick=qq_小小少年; UN=qq_35425276; AU=F3E; BT=1524021398339; __message_sys_msg_id=0; __message_gu_msg_id=0; __message_cnel_msg_id=0; __message_district_code=360000; __message_in_school=0; Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac=1524021397,1524027372,1524027466,1524039180; Hm_lpvt_6bcd52f51e9b3dce32bec4a3997715ac=1524039556; dc_tos=p7dgg4', 'Host': 'blog.csdn.net', 'Origin': 'https://blog.csdn.net', 'Pragma': 'no-cache', 'Referer': 'https://blog.csdn.net/lufy_legend/article/details/12488909', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36', 'X-Requested-With': 'XMLHttpRequest', } } let req = http.request(options,function (res) { console.log(res.statusCode); console.log(JSON.stringify(res.headers)) res.on('data',function (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()
转载请注明原文地址: https://www.6miu.com/read-1600181.html

最新回复(0)