HEAD(1)
β¨ NAME β¨
okay bestie, welcome to the manual page π It's filed as HEAD(1) under User Contributed Perl Documentation π but the actual star of the show is lwp-request, a simple command line user agent π¦
π‘ SYNOPSIS π‘
lwp-request [-afPuUsSedvhx] [-m method] [-b base URL] [-t timeout]
[-i if-modified-since] [-c content-type]
[-C credentials] [-p proxy-url] [-o format] url...
π DESCRIPTION π
ngl this program is so iconic π It lets you send requests to WWW servers and to your local file system. For POST, PUT and PATCH methods, the request content comes in through stdin. The response content gets printed on stdout, and error messages go to stderr. When it's done, it returns a status value that tells you how many URLs failed π
π The options are π
-m <method>β pick the method you want for the request πΈ if you don't use this one, the method gets derived from the name of the program-fβ force the request through even if the program thinks the method is illegal π₯ the server might still reject it eventually, so don't be shocked-b <uri>β this URI becomes the base URI for resolving all the relative URIs you hand over as arguments π§-t <timeout>β sets how long the program waits for a response from the remote server before it gives up β° the default unit is seconds, but you can appendmorhfor minutes or hours. the default timeout is3m, aka 3 minutes-i <time>β sets theIf-Modified-Sinceheader π°οΈ iftimeis the name of a file, it uses that file's modification timestamp. if it's not a file, it gets parsed as a literal date. check out HTTP::Date for the recognized formats-c <content-type>β sets the Content-Type for the request π this only works for requests that take content, which means POST, PUT and PATCH. you can force methods to take content by pairing-fwith-c. the default Content-Type for POST is"application/x-www-form-urlencoded", and the default for the others is"text/plain"-p <proxy-url>β sets the proxy for the requests π‘οΈ the program also loads proxy settings from the environment, and you can turn that off with-P-Pβ don't load proxy settings from the environment π ββοΈ-H <header>β sends this HTTP header with each request π you can stack several of them, like this:
lwp-request \
-H 'Referer: http://other.url/' \
-H 'Host: somehost' \
http://this.url/
if the header name starts with a colon, it won't be canonicalized. see "NON-CANONICALIZED FIELD NAMES" in HTTP::Headers for the deets π
-C <username>:<password>β provides credentials for documents protected by Basic Authentication π if the document is protected and you didn't pass a username and password with this option, the program will prompt you for them
The following options control what gets displayed by the program π
-uβ prints the request method and absolute URL as requests are made π¦-Uβ prints the request headers too, on top of the request method and absolute URL π-sβ prints the response status code π this one is always on for HEAD requests-Sβ prints the response status chain, which shows the redirect and authorization requests the library handles for you π-eβ prints the response headers π this one is also always on for HEAD requests-Eβ prints the response status chain with the full response headers π-dβ don't print the content of the response π-o <format>β processes HTML content in various ways before printing it π if the response isn't HTML, this option does nothing. the legal format values are"text","ps","links","html"and"dump"."text"formats the HTML as plain"latin1"text"ps"formats it as Postscript"links"outputs all the links found in the HTML document, and relative links get expanded to absolute ones"html"reformats the HTML code"dump"just dumps the HTML syntax tree
heads up: the "HTML-Tree" distribution needs to be installed for this option to work. and "HTML-Format" also needs to be installed for-o textor-o psto work π«Ά
-vβ prints the version number of the program and quits π-hβ prints the usage message and quits π§-aβ sets text (ascii) mode for content input and output π if you don't use this, content input and output happens in binary mode
Because this program is built on the LWP library, it only supports the protocols that LWP supports. no more, no less β¨
πΈ SEE ALSO πΈ
lwp-mirror, LWP
π COPYRIGHT π
Copyright 1995-1999 Gisle Aas.
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself π¦
π AUTHOR π
Gisle Aas <gisle@aas.no>
okay that's the whole tea π« this page came from perl v5.42.2, dated 2026-05-19, and it's HEAD(1) all the way down π stay iconic, bestie ππ«Ά
π¦ where this page comes from
- fedora 43: perl-libwww-perl 6.83-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-libwww-perl 6.83-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms