
chitownclone
New User
Feb 24, 2005, 2:02 PM
Post #1 of 2
(800 views)
|
|
HTTP Request Header??
|
Can't Post
|
|
I want to use HTTP::Headers to pull down server-side data (see bottom of page) for the sites I am contacting with HTTP::Request GET. My 'Request' variables are returning the right values, but the my 'Headers' variables are null. I am pretty sure its something simple in my syntax, but can't figure it out. What's the correct syntax when using requesting header data? Thank you very much for the help. ---------------------------------------------------------- #!/usr/bin/perl -w use LWP::Simple; use HTTP::Request; use HTTP::Response; use LWP::UserAgent; use HTTP::Headers; Net::Ping; $url = "http\:\/\/www.mysite.com"; $robot = new LWP::UserAgent; $robot->timeout (10); $request = new HTTP::Request GET => $url; $response = $robot->request( $request ); @content = $response->content . "\n"; $type = $response->content_type . "\n"; require HTTP::Headers; ???? $h = new HTTP::Headers; ???? $response = $robot->request( $request ); ???? $date = $h->date( $request ); ???? $server = $h->server( $request ); ???? ---------------------------------------------------------- Connect to 198.xx.xx.xx on port 80 HEAD / HTTP/1.0 Host: www.mysite.com Connection: close Accept-Encoding: gzip Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */* Accept-Language: en-us User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705) Web-Sniffer/1.0.20 ---------------------------------------------------------- *** Funcationality of: http://web-sniffer.net/***
|