Var util = require ('til '), Https = require ('https '); Var regUrl = "https://ssl.mail.163.com/regall/unireg/call.do;jsessionid=%s? Cmd = register. start & adapter = % s & reforward = common/reform & targetCmd = register. ctrlTop "; Var cookie = 'a = B; c = d ;', Mail = 'regusername', pass = 'Password', vcode = 'abcde '; Var _ regUrl = util. format (regUrl, 'id123455', 'param2 '); Var post_option = url. parse (_ regUrl ); Post_option.method = 'post '; Post_option.port = 443; Var post_data = querystring. stringify ({ 'Name': mail, 'Uid': mail + '@ 163.com ', 'Confirmpassword': pass, 'Password': pass, 'Vcode': vcode, 'Flow': 'main ', 'From': '163mail _ right ', 'Mobile ':'', }); Post_option.headers = { 'Content-type': 'application/x-www-form-urlencoded ', 'Content-length': post_data.length, Cookie: cookie }; Var post_req = https. request (post_option, function (res ){ Res. on ('data', function (buffer ){ Console. log (buffer. toString ()); }); Post_req.write (post_data ); Post_req.end (); |