Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP::Headers Issue

Status
Not open for further replies.

chitownclone

Programmer
Mar 30, 2004
22
0
0
US
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\:\/\/
$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: 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
Referer: ----------------------------------------------------------
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top