I create test WebServices and i am trying to get json form this url
https://query.yahooapis.com/v1/public/yql?q=SELECT%20*%20FROM%20flickr.groups.info%20WHERE%20group_id%3D'22637658%40N00'&format=json&diagnostics=true&callback=
all the time i get ERROR 400,also yahoo gave to me a secret id and key but i don׳t know where to set them. when i cheak the method with:test http request everything work fine.
WEB SERVICES CODE:
public static void httpRequest(String params, String urlAdress, final CallbackBool callback){
try {
URL url = new URL("https://query.yahooapis.com/v1/public/yql?q=SELECT%20*%20FROM%20flickr.groups.info%20WHERE%20group_id%3D'22637658%40N00'&format=json&diagnostics=true&callback=");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setReadTimeout(10000);
connection.setConnectTimeout(15000);
connection.setDoOutput(true);
Log.i("SHOW CONNECTION:",connection.toString());
getJsonData(connection, new ResponseCallback<String>() {
@Override
public void onSuccess(String result) {
Log.i("SHOW NEW JSON",result);
callback.doJob(true);
}
@Override
public void onFailure(String result) {
Log.i("FAILLL!","FAILLL");
callback.doJob(false);
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
callback.doJob(false);
} catch (IOException e) {
e.printStackTrace();
callback.doJob(false);
}
}
my result:ERROR CONNECTION: 400
Where i need to put/set the key and the secret id and how?