nachtmsk has asked for the wisdom of the Perl Monks concerning the following question:
If I type this URL into my browser it brings back the data I need. However, if I use it in the code below I get the 'die' message I have set below. My main task right now is to just get the data from the URL into a perl variable. Later on I can worry about parsing the JSON. I have used LWP before to get data this way, usually XML. I can't figure out why this isn't working.Any help would be appreciated.
Thanks! Mikeuse strict; use warnings 'all'; use LWP::Simple 'get'; use JSON::Parse 'parse_json'; use constant URL => 'https://api.bridgedataoutput.com/api/v2/OData/tes +t/TestData?access_token=xxxxxxxxxxxxxxxxxxxxxx'; my $json = get URL or die "Unable to get JSON data"; my $data = parse_json($json); print $data;
|Replies are listed 'Best First'.|
Re: Getting JSON data from a URL using LWP
by choroba (Archbishop) on Jan 23, 2020 at 21:08 UTC