firefox也是firefox自己定义的请求头;
perl 请求头需要自己定义:
[root@master test]# cat c3.pl
require HTTP::Headers;
$h = HTTP::Headers->new;
#设置一个HTTP头
$h->header('Content-Type' => 'text/plain',
'Accept' => 'image/jpeg',
'Host' => 'www.zjcap.cn',
'User_Agent' => 'Molilla/5.0');
#读取一个HTTP头的值
$ct1 = $h->header('Content-Type');
print $ct1;
$ct2 = $h->header('Host');
print $ct2;
[root@master test]# perl c3.pl
text/plainwww.zjcap.cn[root@master test]#