Hello everyone.
I'm learning how to use the API right now and I ran into a problem. My code looks like this so far:
String gbURL = "http://www.giantbomb.com/api/search/?api_key=THIS-IS-WHERE-MY-API-KEY-IS&format=json&query='sonic'&resources=game";
HttpURLConnection urlConnection = null; URL url = new URL(gbURL);
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.connect();
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()) != null)
{
sb.append(line + "\n");
}
br.close();
String jsonString = sb.toString();
System.out.println("JSON: " + jsonString);
However, as a result, I always get the 101 status code. As far as I know this means "object not found". But there should definitely be results for "sonic", right?
Log in to comment