in reply to How to save the result of a http request in a file

To expand a bit on the solution by cianoz:

You need the LWP module installed, and also the tools that LWP offers to install. The GET programm is not much more than the following Perl oneliner:

# for Windows perl -MLWP::Simple -e "getprint 'http://www.example.com/'" # for Unix perl -MLWP::Simple -e 'getprint q(http://www.example.com/)'

You can also directly store the result in a file using the mirror command of LWP::Simple:

perl -MLWP::Simple -e 'mirror q(http://www.example.com),"example-store +d-page.html"'

Looking back at your previous posts, please think about how you can make your node titles a bit more descriptive. For example, for this node, a title like How to save the result of a http request in a file might have been more descriptive.

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

Replies are listed 'Best First'.
Re: Re: How to save the result of a http request in a file
by bart (Canon) on Aug 04, 2003 at 12:25 UTC