zoukankan      html  css  js  c++  java
  • 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":"用户未登录"}

  • 相关阅读:
    python,抓取百度搜索结果
    python关键字 with
    python 字符串处理
    采用主动模式进行文件的上传、下载
    系统的备份和恢复
    javascript中的defer
    程序调用批处理完成上传、下载
    vb.net中的ftp上传、拨号、socket通讯的源码
    CF1033G Chip Game
    LG3369 普通平衡树
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350567.html
Copyright © 2011-2022 走看看