1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-02 01:18:00 +01:00
tldr/pages/common/lwp-request.md
2016-01-24 02:05:29 -05:00

28 lines
789 B
Markdown

# lwp-request
> Simple command-line HTTP client.
> Built with libwww-perl.
- Make a simple GET request:
`lwp-request -m GET {{http://example.com/some/path}}`
- Upload a file with a POST request:
`cat {{/path/to/file}} | lwp-request -m POST {{http://example.com/some/path}}`
- 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}}`