lwp-request
LWP-Request is a command-line tool used to make HTTP requests and retrieve content from web servers. It is part of the LWP (Library for WWW in Perl) suite of tools, written in Perl. The tool can be used to send different types of HTTP requests, such as GET, HEAD, POST, PUT, DELETE, and OPTIONS. It supports various options and headers, allowing users to customize their requests. LWP-Request handles redirects automatically, following them until it reaches the final destination. Cookies are also supported, enabling sessions and authentication to be maintained between requests. The tool can retrieve different types of content, including HTML pages, images, text files, and more. Response details such as status code, headers, and content are displayed, allowing users to analyze the server's response. LWP-Request can be utilized for testing and debugging web applications, checking the availability and correctness of URLs, and automating web interactions. It is scriptable and can be integrated into larger scripts or workflows for more advanced functionalities.
List of commands for lwp-request:
-
lwp-request:tldr:0b1c0 lwp-request: Make a request with a custom user agent.$ lwp-request -H 'User-Agent: ${user_agent} -m ${METHOD} ${http:--example-com-some-path}try on your machineexplain this command
-
lwp-request:tldr:739fe lwp-request: Make a simple GET request.$ lwp-request -m GET ${http:--example-com-some-path}try on your machineexplain this command
-
lwp-request:tldr:bb810 lwp-request: Upload a file with a POST request.$ lwp-request -m POST ${http:--example-com-some-path} < ${filename}try on your machineexplain this command
-
lwp-request:tldr:d9c42 lwp-request: Make a request and print request headers.$ lwp-request -U -m ${METHOD} ${http:--example-com-some-path}try on your machineexplain this command
-
lwp-request:tldr:f0373 lwp-request: Make a request and print response headers and status chain.$ lwp-request -E -m ${METHOD} ${http:--example-com-some-path}try on your machineexplain this command
-
lwp-request:tldr:f5e8d lwp-request: Make a request with HTTP authentication.$ lwp-request -C ${username}:${password} -m ${METHOD} ${http:--example-com-some-path}try on your machineexplain this command