HTTPS/Authenticated: Difference between revisions
→{{header|Perl6}}: Add Perl6 example
mNo edit summary |
Thundergnat (talk | contribs) (→{{header|Perl6}}: Add Perl6 example) |
||
Line 246:
'.persistent' => 'y', # tick checkbox
});</lang>
=={{header|Perl 6}}==
{{works with|Rakudo|2017.09}}
Used here to connect to my local wireless router to a page that is password protected. Obviously not going to be generally publicly accessible but should be easily adaptable to other sites / devices.
<lang perl6>use HTTP::UserAgent;
my $username = 'username'; # my username
my $password = 'password'; # my password
my $address = 'http://192.168.1.1/Status_Router.asp'; # my local wireless router
my $ua = HTTP::UserAgent.new;
$ua.auth( $username, $password );
my $response = $ua.get: $address;
say $response.is-success ?? $response.content !! $response.status-line;</lang>
=={{header|PicoLisp}}==
|