perl lwp 获取请求头
2016-06-30 11:17
260 查看
<pre name="code" class="html">[root@dr-mysql01 ~]# cat getx.pl use LWP::UserAgent; $ua = LWP::UserAgent->new; @header = ( 'accept'=> "application/json", 'content-type'=> "application/json", 'apix-key'=> "e7b00871640c49567a37566ccd5c27e9", 'User-Agent' => "Mozilla/8.0" ); $host="http://zjcap.cn"; $request = HTTP::Request->new(GET=>"$host"); $request->header(@header); use Data::Dumper; print Dumper($request); my $hdrs = $request->headers; print "111111111111111111111\n"; print Dumper($hdrs); [root@dr-mysql01 ~]# perl getx.pl $VAR1 = bless( { '_uri' => bless( do{\(my $o = 'http://zjcap.cn')}, 'URI::http' ), '_method' => 'GET', '_content' => '', '_headers' => bless( { 'content-type' => 'application/json', 'user-agent' => 'Mozilla/8.0', 'apix-key' => 'e7b00871640c49567a37566ccd5c27e9', 'accept' => 'application/json', '::std_case' => { 'apix-key' => 'Apix-Key' } }, 'HTTP::Headers' ) }, 'HTTP::Request' ); 111111111111111111111 $VAR1 = bless( { 'content-type' => 'application/json', 'user-agent' => 'Mozilla/8.0', 'apix-key' => 'e7b00871640c49567a37566ccd5c27e9', 'accept' => 'application/json', '::std_case' => { 'apix-key' => 'Apix-Key' } }, 'HTTP::Headers' );
相关文章推荐
- perl lwp 获取请求头
- JAVA 爬虫Gecco
- 恭喜发财!
- 如何利用Dropbox备份指定文件夹
- HOOK -- IAT HOOK 本进程MessageBox
- hdu_4521_小明系列问题——小明序列(LIS)
- UITabBarController、TabBar背景颜色设置、TabBarItem颜色处理
- Extjs的一个自定义组件
- iOS查看日志利器 —— socat
- django之常用命令详解
- 优先队列(堆)
- hdu_4521_小明系列问题——小明序列(LIS)
- php系统无法上传图片问题
- nginx ---->flume ----->kafka ----> storm -----> hdfs
- Redis内存使用优化与存储
- 另一种sysenter hook方法(绕过绝大多数的rootkit检测工具的检测)
- *leetcode #162 in cpp
- 利用Dropbox备份vps中的文件
- linux应用层定时器
- java 定时器