response = reader.readLine();while(response != null) { response += reader.readLine();}/*Let's walk through what this is doing.First, it's getting a line from reader, and storing it in the variable: response.Then, as long as response (the variable, not the line) is NOT NULL, it is looping. It is repeatedly adding reader.readLine() to response. Even if reader.readLine() is null, it'll still try to add it. The variable 'response' will NEVER BE NULL unless the FIRST LINE is null. It'll loop forever.*/// Do this instead:response = "";String line = reader.readLine();while (line != null) { response += line; line = reader.readLine();}