I'm using openstreetmap I can only see the inputstream inside the while loop
Here's my code inside the initialize of the javafx Controller:
try {
URL myurl;
myurl = new URL("https://nominatim.openstreetmap.org/search?q=The+White+House,+Washington+DC&format=json&addressdetails=1");
URLConnection yc = myurl.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null)
response.append(inputLine);
} catch (IOException ex) {
Logger.getLogger(WeatherUpdateController.class.getName()).log(Level.SEVERE, null, ex);
}
I am trying to get the StringBuffer inside a string variable so I can search it.