我遇到了这个问题,但不确定是否准确。
我Cannot write output after reading input
在日志中发现,根据上述内容,我相信这是因为 agetResponseCode()
后面跟着 a getOutputStream()
。
这会是我看到的记录错误的原因吗?
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
if(conn.getResponseCode() == 0){
logger.debug("Success");
} else {
logger.debug("Time out set for 30 seconds");
}
String input = writer.getBuffer().toString();
OutputStream os = conn.getOutputStream();
os.write(input.getBytes());