Here is an edited version of something I do for a HTTP GET using Slim::Networking::SimpleAsyncHTTP
Code:
my %headers; $headers{'Content-Type'} = 'application/json'; my $http = Slim::Networking::SimpleAsyncHTTP->new( sub { $meta->{ $station } = parseContent($client, shift->content, $station, $url, V_SONGDATA); }, sub { # in case of an error, don't try too hard... $meta->{ $station } = parseContent($client, '', $station, $url, V_SONGDATA); }, ); $http->get($sourceUrl, %headers);
Comment