GET(1)
β¨ NAME β¨
okay bestie, meet lwp-request π, a simple command line user agent that talks to WWW servers straight from your terminal π»β¨
β¨ 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 β¨
so this program is literally built to send requests to WWW servers and your local file system π¦ the request content for POST, PUT and PATCH gets read from stdin π₯, the response content gets printed on stdout π¨οΈ, and error messages go to stderr π¨. it also returns a status value telling you how many URLs failed π, which is so important π
the options are:
-m <method>β pick the method for the request π if you don't use this, 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 π-b <uri>β this URI becomes the base URI for resolving all the relative URIs you pass as arguments πΈ-t <timeout>β set the timeout for requests β° this is how long the program waits for the remote server to respond before it gives up π€ the default unit is seconds, but you can add "m" or "h" to make it minutes or hours π«Ά the default timeout is3m, i.e. 3 minutes-i <time>β sets the If-Modified-Since header π if time is the name of a file, the program uses that file's modification timestamp π if it isn't a file, it gets parsed as a literal date π check outHTTP::Datefor the recognized formats-c <content-type>β set the Content-Type for the request π this only works for requests that take content, which means POST, PUT and PATCH π you can force other methods to take content by using-ftogether with-cπ¦ the default Content-Type for POST is"application/x-www-form-urlencoded"π the default for the others is"text/plain"π-p <proxy-url>β set the proxy for the requests π§ the program also loads proxy settings from the environment, but you can turn that off with-Pπ ββοΈ-Pβ don't load proxy settings from the environment π«-H <header>β send this HTTP header with each request β¨ you can specify several of these, like this:
lwp-request \
-H 'Referer: http://other.url/' \
-H 'Host: somehost' \
http://this.url/
if the header name is prefixed with a colon, it won't get canonicalized π (see "NON-CANONICALIZED FIELD NAMES" in HTTP::Headers)
-C <username>:<password>β provide credentials for documents protected by Basic Authentication π if the document is protected and you didn't give a username and password with this option, the program will prompt you for them π₯Ί
π Display options π
these options control what gets displayed by the program, and they're giving main character energy π
-uβ print the request method and absolute URL as requests are made π¦-Uβ print the request headers too, on top of the method and absolute URL π-sβ print the response status code π’ this one is always on for HEAD requests π-Sβ print the response status chain π this shows the redirect and authorization requests that the library handles for you π«Ά-eβ print the response headers π¨ this one is also always on for HEAD requests π-Eβ print the response status chain with the full response headers π€―-dβ don't print the content of the response π-o <format>β process 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 π³
theHTML-Treedistribution needs to be installed for this option to work π¨ and theHTML-Formatdistribution also needs to be installed for-o textor-o psto work π
-vβ print the version number of the program and quit π·οΈ-hβ print the usage message and quit π-aβ set text (ascii) mode for content input and output π€ if you don't use this, content input and output is done in binary mode π€
because this program is built on the LWP library, it only supports the protocols that LWP supports π«Ά
β¨ SEE ALSO β¨
lwp-mirror, LWP π¦
β¨ COPYRIGHT β¨
Copyright 1995-1999 Gisle Aas. π
this library is free software, and 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 was the perl v5.42.2 version of GET(1), dated 2026-05-19. go be iconic with your requests, 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