Upload a file with a POST request

lwp-request

  • Simple command-line HTTP client.
    Built with libwww-perl.
    More information: <https://metacpan.org/pod/lwp-request>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

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

click the source code to copy install lwp-request on any operating system with command-not-found.com