GET(1)

πŸ“¦
version 6.83 Β· 5 versions
, in fedora 43, fedora 44

✨ 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 is 3m, 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 out HTTP::Date for 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 -f together 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 🌳
the HTML-Tree distribution needs to be installed for this option to work 🚨 and the HTML-Format distribution also needs to be installed for -o text or -o ps to 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 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