- 415 名前:デフォルトの名無しさん mailto:sage [2006/12/21(木) 00:15:53 ]
- public String post(String URL,String str) {
byte[] data=null;//送信データ int rs=0; try { HttpConnection htcon = (HttpConnection)Connector.open(URL,Connector.READ_WRITE,true); htcon.setRequestMethod(HttpConnection.POST); htcon.setRequestProperty("Content-Type","application/x-www-form-urlencoded"); OutputStream os = htcon.openOutputStream(); data=str.getBytes(); os.write(data); os.close(); rs=htcon.getResponseCode(); InputStream in = htcon.openInputStream(); int len = (int)htcon.getLength(); if (len<0) len=512; byte[] DATA = new byte[len]; in.read(DATA); in.close(); htcon.close(); return new String(DATA); } catch (Exception e) { System.out.println(e.getClass().getName()); return "通信エラー "+rs+e.getClass().getName(); }} 上のソースでPOST通信をしているんですが、SH系ではうまくいくのにV903Tで行うと java.lang.RuntimeExceptionが発生します。 どこがおかしいのか分かりますでしょうか?
|

|