2011-04-25 100 views

回答

1

簡單的代碼是

HttpConnection oCon = (HttpConnection)Connection.open(YOUR_SERVER_URL); 

URLEncodedPostData oPostData = new URLEncodedPostData(URLEncodedPostData.DEFAULT_CHARSET, false); 

oPostData.append("param1", "VALUE 1"); 
oPostData.append("param2", "VALUE 2"); 

OutputStream streamOut = oCon.openOutputStream(); 
streamOut.write(oPostData.getBytes()); 

streamOut.flush(); 
streamOut.close(); 

欲瞭解更多詳情,請參閱peter_strange的支持論壇上發帖「Sample HTTP Connection code and BIS-B Access

這是一個好的開始。

+0

謝謝約翰。你提到這是一個很好的開始。 – 2011-04-25 09:47:46

相關問題