get방식으로는
URL text =
new URL("http://192.168.1.140:8282/Android/android.action?id="+id.getText()+"&pw="+pw.getText()+"&name="+name.getText()+"&tel="+tel.getText());
이렇게 보내면 되던데,, get방식은 길이에 제한이 있으니...post방식으로 보내고 싶은데_
어떻게 해야할지 모르겠습니다.
좀 가르쳐주세요오///ㅠ
이렇게 하니 되더군요.
---------------------------------------------------------------------------------------------------------
try {
// Construct data
String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");
// Send data
URL url = new URL("http://192.168.1.140:8282/Android/android.action");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
// Process line...
}
wr.close();
rd.close();
} catch (Exception e) {
}