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 ?
In reply to url issues using HTTP::Tiny by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |