日期:2014-05-19 浏览次数:21564 次
HttpClient client = new HttpClient();
PostMethod postMethod = new PostMethod("http://122.22.22.2:2222/Object/HrTms.do");
postMethod.setRequestHeader("Content-type",
"application/x-www-form-urlencoded; charset=UTF-8");
// 泛型List -> Json
java.lang.reflect.Type type = new com.google.gson.reflect.TypeToken<List<Tab_User>>() {
}.getType();
String json = gson.toJson(pageList, type);
_log.debug(serviceUrl + "发送 Hr Json:" + json);
postMethod.setRequestBody(new NameValuePair[] {
new NameValuePair("Type", "Hr"),
new NameValuePair("data", json)
});
int status = 0;