in reply to Re^6: How to download or run exe file using rest client.
in thread How to download or run exe file using rest client.

Hi Poj, Thanks for the reply.
Result of the asked program

MSWin32 Perl v5.14.2 LWP 6.03 400 URL must be absolute Content-Type: text/plain Client-Date: Wed, 20 Mar 2019 14:20:34 GMT Client-Warning: Internal response 400 URL must be absolute

Regards.

Replies are listed 'Best First'.
Re^8: How to download or run exe file using rest client.
by poj (Abbot) on Mar 20, 2019 at 15:18 UTC

    Did you use your url, not 'URL' ?

    my $url = 'http://server_address:port/ws/1/console/webstart?full=true' +;
    poj

      Hi Poj, Below is the output of my URL,

      MSWin32 Perl v5.14.2 LWP 6.03 HTTP/1.1 401 Unauthorized Connection: Close Date: Wed, 20 Mar 2019 15:26:27 GMT Server: servername Content-Length: 95 Client-Date: Wed, 20 Mar 2019 15:26:29 GMT Client-Peer: 10.133.185.36:1611 Client-Response-Num: 1 Client-Warning: Missing Authenticate header X-Frame-Options: SAMEORIGIN

      Regards

        Try setting UserAgent to same as your browser

        #!perl use strict; use warnings; use LWP::UserAgent(); printf "%s Perl %s LWP %s\n\n",$^O,$^V,$LWP::VERSION; my $url= 'http://server_address:port/ws/1/console/webstart?full=true'; my $ua = LWP::UserAgent->new; $ua->agent("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)"); my $resp = $ua->head($url); print $resp->as_string;

        What is the size in bytes of the file downloaded via the browser ?

        poj