#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; use Crypt::SSLeay; my $mech = WWW::Mechanize->new(); # Don't pass the full URL as the location in the call to credentials! my $server = 'api.datamarket.azure.com'; my $url = "https://$server/Bing/SearchWeb/Web?Query=%27Xbox%27&$top=10&$format=JSON"; my $loc = "$server:443"; my $account_key = ""; # Yes, WWW::Mech still supports LWP::UserAgent's four arg credentials $mech->credentials($loc, '', '', $account_key); $mech->get($url); print $mech->content();