URL url = new URL(urlStr);
HttpURLConnection urlRequest = (HttpURLConnection) url.openConnection();
urlRequest.setRequestMethod("POST");
// request를 서명합니다.
testConsumer.sign(urlRequest);
urlRequest.connect();
BufferedReader br = new BufferedReader(new InputStreamReader(urlRequest.getInputStream()));
String tmpStr = "";
while( (tmpStr = br.readLine()) != null) {
System.out.println("텍스트만 등록 후 메시지==========="+tmpStr);
}
I don't see anywhere in the code where you specify that this is a POST request. Then again, you need a java.net.HttpURLConnection
to do that.
In fact, I highly recommend using HttpURLConnection
instead of URLConnection
, with conn.setRequestMethod("POST");
and see if it still gives you problems.
기본은 get 인가보다..... 이거때문에 한참 삽질했네. 트위터 덕분에 많이 배운다.