1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-05 08:35:23 +02:00
tldr/pages/common/lwp-request.md
Managor 4b1e0196d1
common/*: reduce usage of "command-line" (part 3) (#16951)
Co-authored-by: Dylan <145150333+dmmqz@users.noreply.github.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: Wiktor Perskawiec <wiktor@perskawiec.cc>
2025-06-28 13:12:44 +00:00

831 B

lwp-request

Simple HTTP client. Built with libwww-perl. More information: https://metacpan.org/pod/lwp-request.

  • Make a simple GET request:

lwp-request -m GET {{http://example.com/some/path}}

  • Upload a file with a POST request:

lwp-request -m POST {{http://example.com/some/path}} < {{path/to/file}}

  • Make a request with a custom user agent:

lwp-request -H 'User-Agent: {{user_agent}} -m {{METHOD}} {{http://example.com/some/path}}

  • Make a request with HTTP authentication:

lwp-request -C {{username}}:{{password}} -m {{METHOD}} {{http://example.com/some/path}}

  • Make a request and print request headers:

lwp-request -U -m {{METHOD}} {{http://example.com/some/path}}

  • Make a request and print response headers and status chain:

lwp-request -E -m {{METHOD}} {{http://example.com/some/path}}