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

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

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

    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