您的位置:首页 > 其它

perl post 带上请求头

2016-04-20 11:32 363 查看
my $url='https://www.zjcap.cn/business/dispatch_post.do?action=submitAdminLogin';
my $res = $ua->post($url,{
'userName'=>'xxx',
'userPass'=>'3xxx8599e549ff',
'userPass1'=>'xxx56',
'validCode'=> "$validCode"
},
'User-Agent'=>'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0',
'Host'=>'www.zjcap.cn',
'Referer'=>'https://www.zjcap.cn/backoffice/login.html'

);
print "---------------\n";

#my $head =$res->header('Location');
print $res->header('Location');
print "\n";

print $res->status_line."\n";
print $res->as_string();#获取的是原始内容,包括响应头,响应正文
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: