lwp-request
command-line HTTP client from the LWP suite
TLDR
GET request
SYNOPSIS
lwp-request [-m method] [-f] [-H header] [-c content-type] [-C content] [options] url
DESCRIPTION
lwp-request is a command-line HTTP client from the LWP (Library for WWW in Perl) suite. It sends HTTP requests and displays responses.
The tool is also available as GET, POST, and HEAD commands, which are symlinks with preset methods. These shortcuts simplify common operations.
Output options control what gets printed: request details (-U, -S, -d) and response details (-e, -s). Combined flags show the full transaction for debugging.
Authentication, cookies, and proxy settings come from environment variables or configuration files. It integrates with the Perl LWP ecosystem.
For simple testing and scripting, lwp-request provides HTTP access without additional dependencies beyond Perl's LWP modules.
PARAMETERS
-m METHOD
HTTP method (GET, POST, HEAD, PUT, DELETE).-f
Follow redirects.-H HEADER
Add custom header.-c TYPE
Content-Type for request body.-C CONTENT
Content/body data.-b URI
Base URI for relative URLs.-o FORMAT
Output format.-d
Print request content/body.-e
Print response headers.-s
Print response status.-S
Print request URL.-U
Print request headers.-t SECONDS
Timeout.-a
Use text mode for content.
CAVEATS
Requires libwww-perl package. Less feature-rich than curl or httpie. Error handling is basic. Large file downloads may be slow.
HISTORY
lwp-request is part of libwww-perl, created by Gisle Aas starting in the 1990s. LWP became the standard HTTP library for Perl, and lwp-request provided command-line access to its functionality.
