This site requires JavaScript, please enable it in your browser!
Greenfoot back

Recent Comments | Show All

tsimmonds278@gmail.com
tylers

2013/12/23

and String answer; URL url = new URL(to); HttpURLConnection connection = (HttpURLConnection)url.openConnection(); connection.setRequestMethod("GET"); connection.setDoInput(true); connection.setDoOutput(true); connection.setUseCaches(false); connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; for(answer = ""; (line = reader.readLine()) != null; answer = (new StringBuilder()).append(answer).append(line).toString()) { } return answer; IOException e; e; e.printStackTrace(); return "error";