Way of reopening connection in java.net.HttpURLConnection
问题 First, I open a connection and send some data to server. Next I get a response. HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); wr = new OutputStreamWriter(connection.getOutputStream()); wr.write("some text sent to server"); wr.flush(); //read the server answer rd = new BufferedReader(new InputStreamReader(connection.getInputStream())); ... What I need is to repeat the whole cycle again - send data and receive answer. The problem is that if I use the same wr