perl post 请求相关参数

    $ua->post( $url, \%form )
    $ua->post( $url, \@form )
    $ua->post( $url, \%form, $field_name => $value, ... )
    $ua->post( $url, $field_name => $value,... Content => \%form )
    $ua->post( $url, $field_name => $value,... Content => \@form )
    $ua->post( $url, $field_name => $value,... Content => $content )
        This method will dispatch a "POST" request on the given $url, with
        %form or @form providing the key/value pairs for the fill-in form
        content. Additional headers and content options are the same as for
        the get() method.
		
		
		这个方法会调用一个POST 请求在给定的$url上,使用%form 或者@form 提供键值对 对于填充内容,
		
		额外的 headers 和内存选项是和get()方法一样
		第一个参数是登陆的地址,第二个参数是一个匿名hash,第三个参数是请求头
		   my $url='https://wenjinbao.winfae.com/business/dispatch_post.do?action=submitAdminLogin';
   my $res = $ua->post($url,{
	                         'userName'=>'IT_public',
							 #'userName'=>'ITxxxx',
                             'userPass'=>'xxx',
						     'userPass1'=>'xx',
                            'validCode'=> "$validCode"
                                                  },
				'User-Agent'=>'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0',
                 'Host'=>'wenjinbao.winfae.com',
                 'Referer'=>'https://wenjinbao.winfae.com/backoffice/login.html'				
				
										);
										

转载于:https://www.cnblogs.com/zhaoyangjian724/p/6199181.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值