• perl post 请求带参数




    my $url='https://wenjinbao.winfae.com/business/dispatch_post.do?action=submitAdminLogin';
       my $res = $ua->post($url,{
                            'userName'=>'IT_public',
    #'userName'=>'ITxxxx',
                                 'userPass'=>'xx',
        'userPass1'=>'xx',
                                'validCode'=> "$validCode"
                                                      },
                      [
                    'action'        => 'submitAdminLogin'
                    
                ],
    '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'


    );
    print "--------------- ";


    带上['action'        => 'submitAdminLogin' ],


    反而报错,这参数url的参数,不是post的参数


    F:>perl a2.pl
    登录二维码已经下载到本地 [ C:wj_jth_dlxv.jpg ]
    dr8e
    $validCode is dr8e
    $str is {"result":true}
    ---------------


    400 Bad request
    HTTP/1.0 400 Bad request
    Cache-Control: no-cache
    Connection: close
    Content-Type: text/html
    Client-Date: Fri, 08 Jul 2016 14:22:59 GMT
    Client-Peer: 120.55.138.118:443
    Client-Response-Num: 1
    Client-SSL-Cert-Issuer: /C=BE/O=GlobalSign nv-sa/CN=GlobalSign Domain Validation
    Client-SSL-Cert-Subject: /OU=Domain Control Validated/CN=*.winfae.com
    Client-SSL-Cipher: ECDHE-RSA-AES256-SHA
    Client-SSL-Socket-Class: IO::Socket::SSL


    <html><body><h1>400 Bad request</h1>
    Your browser sent an invalid request.
    </body></html>
    $str is {"retCode":"4005","retMsg":"用户未登录"}

  • 相关阅读:
    Spring Boot|Async
    SonarQube使用
    大数据|linux权限chmod和chown
    Spring Boot|监控-Actuator
    Docker|部署及简单使用
    Spring|IOC启动流程
    Spring|注解
    Spring|@Autowired与new的区别
    Spring|Spring MVC
    个人站点
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199660.html
Copyright © 2020-2023  润新知