I am trying to shift my Bing API from old one to new Windows Azure Marketplace
My code is like this:
String serviceUrl = "https://api.datamarket.azure.com/Data.ashx/Bing/SearchWeb/
v1/Web?Query='"+ query+"'";
byte[] accountKeyBytes = Base64.encodeBase64(( bingAzureApiKey + ":" +
bingAzureApiKey).getBytes());
String accountKeyEnc = new String(accountKeyBytes);
URL celebSearchurl = new URL(serviceUrl);
URLConnection urlc = celebSearchurl.openConnection();
urlc.addRequestProperty("Authorization", "Basic "+accountKeyEnc);
urlc.setConnectTimeout(2500);
urlc.setReadTimeout(2500);
But I am getting 400 error for the same. I am failing to understand what am I doing wrong here?