随笔分类 -  LWP::UserAgent

perl中设置POST登录时的重定向
摘要:默认地, perl提交post登录时是不会重定向的 要让它重定向, 可以用如下方法: 阅读全文

posted @ 2017-04-14 04:57 Perl6 阅读(230) 评论(0) 推荐(0) 编辑

perl发送post数据
摘要:把post数据写进一个匿名数组里就行 或 或 如果用最后一个方法, 记得要带有content_type头才行 阅读全文

posted @ 2017-02-26 22:25 Perl6 阅读(1220) 评论(0) 推荐(0) 编辑

LWP::UserAgent介绍3 -> cookie设置
摘要:#或者可以如下所示 还有, 如果你是想在发送请求时一起发送指定cookie, 可以这样: 阅读全文

posted @ 2016-12-06 09:04 Perl6 阅读(905) 评论(0) 推荐(0) 编辑

LWP::UserAgent介绍2
摘要:1 #这个LWP::UserAgent一般要配合其他模块使用 2 #比如: 3 #HTTP::Request 4 #HTTP::Cookie 5 #HTTP::Respose 6 #HTTP::Status 7 #LWP::UserAgent相当于创建一个模拟浏览器 8 9 #用以下方式创一个浏览器 10 my $useragent = LWP::UserAgent->ne... 阅读全文

posted @ 2016-12-06 09:03 Perl6 阅读(1077) 评论(0) 推荐(0) 编辑

perl LWP::UserAgent获取源码与响应
摘要:1 #!/usr/bin/perl -w 2 use strict; 3 use LWP::UserAgent; 4 5 my $useragent = new LWP::UserAgent; 6 my $url = 'http://www.baidu.com'; 7 my $request = HTTP::Request->new(GET => $url); 8 my $r... 阅读全文

posted @ 2016-12-06 09:02 Perl6 阅读(802) 评论(0) 推荐(0) 编辑

LWP::UserAgent介绍1
摘要:1 require LWP::UserAgent; 2 3 my $ua = LWP::UserAgent->new; 4 $ua->timeout(10); 5 $ua->env_proxy; 6 7 my $response = $ua->get('http://search.cpan.org/'); 8 9 if ($response->is_success)... 阅读全文

posted @ 2016-12-06 09:02 Perl6 阅读(464) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示