for talking to restful web services
use strict;
use warnings;
use LWP::UserAgent;
use URI;
use JSON::XS;
use HTTP::Request;
use HTTP::Headers;
use File::Path qw( mkpath );
use REST::Consumer::Reque
file_path {
my ($uri) = @_;
my $cache_filename = $uri->host . '-' . $uri->port . $uri->path . '.json';
# $cache_filename =~ s/\//-/g;
my ($dir, $filename) = $cache_filename =~ /(.*)\/([^\/]*)/i;
r
e "Couldn't open config file '$path': $!";
my $data = <$config_fh>;
my $decoded_data = JSON::XS::decode_json($data);
close $config_fh;
return $decoded_data;
}
sub write_config_to_file {
my ($ur