LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lwp-request

command-line HTTP client from the LWP suite

TLDR

GET request
$ lwp-request [https://example.com/]
copy
POST request with data
$ lwp-request -m POST -c 'application/json' -C '[{"key":"value"}]' [https://api.example.com/]
copy
HEAD request (headers only)
$ lwp-request -m HEAD [https://example.com/]
copy
Show response headers and content
$ lwp-request -USed [https://example.com/]
copy
Follow redirects
$ lwp-request -f [https://example.com/redirect]
copy
Use specific method
$ lwp-request -m [DELETE] [https://api.example.com/resource]
copy
Set custom header
$ lwp-request -H 'Authorization: Bearer [token]' [https://api.example.com/]
copy
Save to file
$ lwp-request [https://example.com/file] > [output]
copy

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.

INSTALL

sudo pacman -S perl-libwww
copy
sudo apk add perl-libwww
copy

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.

SEE ALSO

curl(1), wget(1), http(1), httpie(1), perl(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid