ve6sar has asked for the wisdom of the Perl Monks concerning the following question:
Ok Monks, I've been reading your wisdom for years, but alas I can't seems to find the answer to my current problem.
I need my Perl script to connect to a specific https page where JSON data is continuously streamed for parsing. So far I'm still trying to get connected to the page. Using the code below it will connect to the root page.
#!/usr/bin/perl use strict; use IO::Socket::SSL; # qw(debug3); # simple client my $cl = IO::Socket::SSL->new( PeerAddr => 'example.com:https', ) or die $!; print $cl "GET / HTTPS/1.0\r\n\r\n"; print <$cl>;
The one I need to connect to is in a sub directory with an access token with the code below gives me an "Invalid argument" error.
#!/usr/bin/perl use strict; use IO::Socket::SSL; # qw(debug3); # simple client my $cl = IO::Socket::SSL->new( PeerAddr => 'example.com/stream/report?token=4gaPemdzfM2M9 +XwMU9HT8MJSc6Fu6MlA:https', ) or die $!; print $cl "GET / HTTPS/1.0\r\n\r\n"; print <$cl>;
I know I'm missing something simple but for the life of me I can't figure it out.
Thanks for your help, Sean
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: io::socket::ssl connecting to specific page on site
by huck (Prior) on Apr 12, 2017 at 02:50 UTC | |
by noxxi (Pilgrim) on Apr 12, 2017 at 15:04 UTC | |
by ve6sar (Novice) on Apr 14, 2017 at 20:57 UTC | |
by ve6sar (Novice) on Apr 12, 2017 at 04:01 UTC |