I'm trying to connect to Grooveshark api. This is Grooveshark guideline for signing the request: http://developers.grooveshark.com/tuts/public_api
This is how I sign my data. But I get the error :"signature not valid". Should I form JsonObject or data can be String?
String data = "{\"method\":\"getArtistSearchResults\",\"parameters\":{\"query\":\"adele\"},\"header\":{\"wsKey\":\"concertboom\"}}";
String key = "XXXXX";
SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "HmacSHA1");
Mac mac = Mac.getInstance("HmacMD5");
mac.init(keySpec);
byte[] result = mac.doFinal(data.getBytes());
BASE64Encoder encoder = new BASE64Encoder();
signature = encoder.encode(result);