HttpURLConnection参数以XML形式封装
//得到连接
public static HttpURLConnection setRequest(String urlStr) {
HttpURLConnection con = null;
try {
URL url = new URL(urlStr);
try {
con = (HttpURLConnection) url.openConnection();
con.setDoOutput(true);
con.setDoInput(true);
con.setRequestProperty("Pragma:", "no-cache");
con.setRequestMethod("POST");
con.setRequestProperty("Cache-Control", "no-cache");
con.setRequestProperty("Content-Type", "text/xml");
} catch (IOException e) {
e.printStackTrace