したのコードでは POST のメッセージが飛ばない.
URLConnection con = new URL(path).openConnection(); con.setDoOutput(true); con.setDoInput(false); PrintWriter pw = new PrintWriter(con.getOutputStream()); pw.println(path + " " + con); pw.flush(); pw.close(); System.out.println(path + " " + con);
どうやら InputStream を開いてやらないとサーバに POST のメッセージすら送ってくれないらしい.これに気づくのにかなりの時間を喰った… が,あとすこしなのでがむばろう.
- Newer: AWK - はじめ