现在一个应用需要访问不同域下的TAM安全认证服务,需要模拟form表单提交到WebSEAL,先谢谢了。以下是我目前尝试的http请求写法:varhttp=require('http');varquerystring=require('querystring');varpost_options={host:'192.168.1.22',port:'80',path:'/pkmslogin.form',method:'post',auth:'username:123456','login-form-type':'pwd',headers:{'Content-Type':'application/x-www-form-urlencoded'}};varpost_data=querystring.stringify({username:'username',password:'123456','login-form-type':'pwd'});//Setuptherequestvarpost_req=http.request(post_options,function(res){res.setEncoding('utf8');console.log(JSON.stringify(res.headers));res.on('data',function(chunk){console.log('Response:'+chunk);});});console.log(JSON.stringify(post_req.headers));//postthedata//post_req.write(post_data);post_req.end();
元芳怎么了
相关分类