package Geo::Coder::TomTom;
use strict;
use warnings;
use Carp qw(croak);
use Encode ();
use JSON;
use LWP::UserAgent;
use URI;
our $VERSION = '0.04';
$VERSION = eval $VERSION;
sub new {
my ($
=> 'json',
%params,
);
my $res = $self->{response} = $self->ua->get($uri);
return unless $res->is_success;
# Change the content type of the response from 'application/json' s
my $content = $res->decoded_content;
return unless $content;
my $data = eval { from_json($content) };
return unless $data;
# Result is a list only if there is more than one item