Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

How to download or run .exe file using REST CLIENT. Any example would be useful.

Thanks

  • Comment on How to download or run exe file using rest client.

Replies are listed 'Best First'.
Re: How to download or run exe file using rest client.
by thanos1983 (Parson) on Mar 19, 2019 at 16:18 UTC

    Hello Anonymous Monk,

    What exactly are you trying to do? It sounds a bit strange to me to execute an .exe file from a REST client. A REST client could download a file e.g. from module LWP::Simple.pm/getstore.

    Regarding on how to execute a file see How to run a .exe file from a Perl script?.

    Looking forward to your reply.

    BR / Thanos

    Seeking for Perl wisdom...on the process of learning...not there...yet!

      Hi Thanks for the reply.

      Basically I am using Rest::client module to download the exe file, i could able to get the responsecontent but I am wondering how we can download the file itself using Rest::client module.

      Regards

        Hello again Anonymous Monk,

        I think I understand what you mean. I assume you are able to see the output of the page that you want to download but how to store it locally you mean.

        There are many ways to do it, sample below:

        #!/usr/bin/perl use strict; use warnings; use REST::Client; #The basic use case my $client = REST::Client->new(); $client->GET('https://perlmaven.com/'); print $client->responseContent(); __END__ $ perl test.pl > index.html

        Further documentation for reference of alternative ways how do i redirect STDOUT, STDIN, or STDERR to a FILE? and https://perlmaven.com/simple-way-to-fetch-many-web-pages.

        Let me know if still is not clear. BR / Thanos

        Seeking for Perl wisdom...on the process of learning...not there...yet!
Re: How to download or run exe file using rest client.
by Aldebaran (Curate) on Mar 19, 2019 at 16:35 UTC

    Your rather ubrupt query could generate a bit of animosity, but I'll give you the benefit of the doubt, maybe, thinking that english isn't your first language. When you're from the midwest you need a paragraph to say "hello" or begin the 5-paragraph theses of our inculcation. I don't think you're from Chicago, nor Oxford, nor Berlin. (Germans know english better than we do.)

    You proved that you had done nothing to research this, so now you've read a paragraph. The namespace for "rest" and "client" is a trafficked one. Do you mean REST::Client? cpan

      Hi Aldebaran, I am from EARTH :)

        So you're running windows? Is there a proxy wall of some sort?