把post数据写进一个匿名数组里就行

 #!/usr/bin/env perl -w
use strict;
use LWP::UserAgent; my $ua = LWP::UserAgent->new();
my $rp = $ua->post('http://www.baidu.com', ['username' => 'admin','passwd' => 'password'])
print $rp->content();

 use LWP::UserAgent;
my $ua = LWP::UserAgent->new(); my $rep = $ua->post('http://localhost/1.php', {cmd => 'whoami'});
#my $rep = $ua->post('http://localhost/1.php', ['cmd' => 'whoami']);
print $rep->content;

 use LWP::UserAgent;
my $ua = LWP::UserAgent->new();
my $req = HTTP::Request->new(POST => 'http://localhost/1.php');
$req->content('cmd=whoami');
$req->content_type('application/x-www-form-urlencoded');
my $rp = $ua->request($req);
print $rp->content;

如果用最后一个方法, 记得要带有content_type头才行

最新文章

  1. yii create url (二)
  2. centos7编译安装nginx1.8
  3. hdu 4939 Stupid Tower Defense ( dp )
  4. OCI的结果输出
  5. [置顶] android之存储篇_SQLite数据库_让你彻底学会SQLite的使用
  6. PDF解决方案(1)--文件上传
  7. MBR . Have it removed!
  8. python+selenium自动化测试环境安装
  9. 芝麻HTTP:Python爬虫实战之抓取爱问知识人问题并保存至数据库
  10. jQuery 嵌套 event 会触发多次的原因
  11. AX_SysTableBrowser
  12. 一把梭系列 之 颜值不够VsCode来凑
  13. CORS jsonp
  14. 服务器被ddos攻击?分析如何防止DDOS攻击?
  15. locals()
  16. Qt绘图
  17. 【洛谷 P1502】 窗口的星星(扫描线)
  18. HTML5+ MUI实现ajax的一个demo
  19. TP5.1:实现分页
  20. SHA256兼容性

热门文章

  1. [转]Windows 7 蓝屏后获取 MEMORY.DMP 文件及注意事项
  2. GetTickCount 和getTickCount
  3. Dom-直接 /间接选择器
  4. 【刷题】BZOJ 2882 工艺
  5. BZOJ2693:JZPTAP——题解
  6. 洛谷4578 & LOJ2520:[FJOI2018]所罗门王的宝藏——题解
  7. The driver has not received any packets from the server
  8. ContestHunter暑假欢乐赛 SRM 05
  9. 【树形DP】【UVA10859】 Placing Lampposts
  10. Sql Server 2008 R2 数据库脚本导出方法