HTTPUrlConnection error (Can't open OutputStream after reading from an inputStream)
问题 I am new to Java and am running into the above mentioned error while using HTTPURLConnection to send multiple post requests on Android. I have written an HTTPTransport class in which I would like to have sendMessage and recvMessage methods. public class HTTPTransport { private HttpURLConnection connection; public HTTPTransport() { URL url = new URL("http://test.com"); connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setDoInput(true);