Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am on a Linux host and if I do this
wget 'https://mytarget.com:9999/Mode/schedule/Host/myhost?User=myuser&Token=XXXXX-AXXX-4812-B123-XXXXXXXXC&type=xml'I get
--2019-09-18 13:07:18-- 'https://mytarget.com:9999/Mode/schedule/Host/ +myhost?User=myuser&Token=XXXXX-AXXX-4812-B123-XXXXXXXXC&type=xml Resolving mytarget.com... xxx.xxx.xxx.xxx Connecting to mytarget.com|xxx.xxx.xxx.xxx|:9999... connected. HTTP request sent, awaiting response... 200 OK Length: 371 [application/xml] Saving to: .....
I am trying to convert this to perl so I am using this code
use strict; use warnings; use Data::Dumper; use feature 'say'; use HTTP::Tiny; my $Client = HTTP::Tiny->new(); my @urls = ( 'https://mytarget.com:9999/Mode/schedule/Host/myhost?User=myuser&T +oken=XXXXX-AXXX-4812-B123-XXXXXXXXC&type=xml', 'https://notarealsite.com:9999', ); for my $url (@urls) { my $response = $Client->get($url); say $url, ": ", $response->{status}; }
But when I run it I get
https://mytarget.com:9999/Mode/schedule/Host/myhost?User=myuser&Token= +XXXXX-AXXX-4812-B123-XXXXXXXXC&type=xml: 599 https://notarealsite.com:9999: 599
My understanding is that this means it's not able to contact the target
It's undoubtedly something simple I have missed but what am I doing wrong ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: url issues using HTTP::Tiny
by haukex (Archbishop) on Sep 18, 2019 at 13:40 UTC | |
by marto (Cardinal) on Sep 18, 2019 at 13:43 UTC | |
by Anonymous Monk on Sep 18, 2019 at 14:56 UTC | |
by Corion (Patriarch) on Sep 18, 2019 at 14:59 UTC | |
by Anonymous Monk on Sep 18, 2019 at 19:15 UTC | |
by Corion (Patriarch) on Sep 19, 2019 at 07:35 UTC | |
by hippo (Archbishop) on Sep 19, 2019 at 09:08 UTC | |
| |
by Anonymous Monk on Sep 19, 2019 at 10:54 UTC | |
|
Re: url issues using HTTP::Tiny
by marto (Cardinal) on Sep 18, 2019 at 13:32 UTC |