POST(1)

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

πŸ“š NAME πŸ“š

User Contributed Perl Documentation 🌸

Okay bestie, this is lwp-request πŸ’–, a simple command line user agent that's lowkey iconic.

πŸŽ€ 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 little program is the one for sending requests to WWW servers AND your local file system πŸ’…. For POST, PUT and PATCH methods, the request content gets read from stdin. The response content comes out on stdout, error messages go to stderr, and the program hands back a status value showing how many URLs failed πŸ’€.

Here are the options 🧚:

  • -m <method> β€” Picks which method to use for the request. If you don't use this option, the method is derived from the name of the program.
  • -f β€” Forces the request through, even if the program thinks the method is illegal. Ngl, 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> β€” Sets the timeout for requests. That's how long the program waits for the remote server to respond before it gives up. The default unit is seconds, but you can tack on an 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 in the request. If time is the name of a file, the program 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 other methods to take content by pairing -f 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> β€” Sets the proxy for the requests. The program also loads proxy settings from the environment, and you can turn that off with the "-P" option.
  • -P β€” Don't load proxy settings from the environment. Main character energy πŸ‘‘.
  • -H <header> β€” Sends this HTTP header with each request. You can specify several, 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) πŸ¦‹.

  • -C <username>:<password> β€” Provides 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 πŸ”.

πŸ‘€ What Gets Displayed πŸ‘€

The following options control what the program shows you:

  • -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 is always on for HEAD requests ✨.
  • -S β€” Prints the response status chain. This shows the redirect and authorization requests the library handles for you.
  • -e β€” Prints the response headers. This is always on for HEAD requests.
  • -E β€” Prints the response status chain with the full response headers.
  • -d β€” Doesn't print the content of the response. Quiet mode, bestie 🀫.
  • -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 every link found in the HTML document, and relative links get expanded to absolute ones πŸ”—.
    • "html" reformats the HTML code, and "dump" just dumps the HTML syntax tree 🌳.
Heads up: the HTML-Tree distribution has to be installed for this option to work. On top of that, HTML-Format 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 option, input and output are done in binary mode 🧾.

Because this program is built on the LWP library, it only supports the protocols LWP supports. No cap 🧒.

🌈 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>


And that's the whole tea, bestie 🫢. It's from perl v5.42.2, dated 2026-05-19, and filed under POST(1) πŸ’œβœ¨

πŸ“¦ where this page comes from