정확히 일치하지는 않지만 정확히 this 문제가 발생합니다.입력을 읽은 후에 출력을 쓸 수 없습니다. 이 문제가 발생했으나 확실하지는 않음
나는 로그에서 Cannot write output after reading input
을 발견했으며, 위의 설명에 따르면 getResponseCode()
다음에 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());
코드는 어디에 입력 읽은 후 출력을 쓸 수 없습니다? 이 오류가 발생하는 줄 주변에 스 니펫을 게시 할 수 있습니까? –