HEAD(1)

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

✨ 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 append m or h for minutes or hours. the default timeout is 3m, aka 3 minutes
  • -i <time> β€” sets the If-Modified-Since header πŸ•°οΈ if time is 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 -f with -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 text or -o ps to 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 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