On Fri, Dec 10, 2021 at 6:44 AM Salvador Fandiño <sfandino@gmail.com> wrote: > > On 10/12/21 11:37, Nicholas Clark wrote: > > > 2) Are curl and wget likely to be found on Win32? Is there any command line > > tool that a HTTP::TIMTOWTDI module can shell out to, to deal with https? > > > > This works for me on Windows 10: > > bitsadmin /rawreturn /transfer perl /download ^ > https://www.cpan.org/src/5.0/perl-5.34.0.tar.gz ^ > c:\users\salva\perl2.tgz > > > Also, urlmon.dll provides URLDownloadToFile: > > $d = Win32::API->new(urlmon => URLDownloadToFileA => 'NPPNN', 'N'); > $d->Call(0, "https://www.cpan.org/src/5.0/perl-5.34.0.tar.gz", > 'c:\users\salva\perl3.tgz', 0,0); > Those look promising. It appears that PowerShell's Invoke-WebRequest, Invoke-RestMethod, and Start-BitsTransfer could all do the job as well. Very recent versions of Windows include OpenSSH, but I don't think it's enabled by default, so sftp is probably not a practical alternative (if that's even enabled on the server side). I like the urlmon solution since it doesn't even involve spawning an external command, but Win32::API is not in core, is it? So bitsadmin might be the simplest and most reliable solution.Thread Previous | Thread Next