public
static
void
HttpPostData(String reg_id, String pnum, String type) {
try
{
URL url =
new
URL(server_url);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setDefaultUseCaches(
false
);
http.setDoInput(
true
);
http.setDoOutput(
true
);
http.setRequestMethod(
"POST"
);
http.setRequestProperty(
"content-type"
,
"application/x-www-form-urlencoded"
);
StringBuffer buffer =
new
StringBuffer();
buffer.append(
"reg_id"
).append(
"="
).append(reg_id).append(
"&"
);
buffer.append(
"phone_num"
).append(
"="
).append(pnum).append(
"&"
);
buffer.append(
"info1"
).append(
"="
).append(appinfo1).append(
"&"
);
buffer.append(
"info2"
).append(
"="
).append(appinfo2).append(
"&"
);
buffer.append(
"info3"
).append(
"="
).append(appinfo3).append(
"&"
);
buffer.append(
"type"
).append(
"="
).append(type);
OutputStreamWriter outStream =
new
OutputStreamWriter(http.getOutputStream(),
"EUC-KR"
);
PrintWriter writer =
new
PrintWriter(outStream);
writer.write(buffer.toString());
writer.flush();
InputStreamReader tmp =
new
InputStreamReader(http.getInputStream(),
"EUC-KR"
);
BufferedReader reader =
new
BufferedReader(tmp);
StringBuilder builder =
new
StringBuilder();
String str;
while
((str = reader.readLine()) !=
null
) {
builder.append(str +
"\n"
);
}
HttpPostData_Result = builder.toString();
}
catch
(MalformedURLException e) {
}
catch
(IOException e) {
}
}