@
xuwei0056 @
chendy 使用 HttpClient PostMethod 配合 URLEncoder 是可以成功发送中文的:
HttpConnectionManager httpConnectionManager = new MultiThreadedHttpConnectionManager();
HttpConnectionManagerParams params = httpConnectionManager.getParams();
params.setConnectionTimeout(5000);
params.setSoTimeout(20000);
params.setDefaultMaxConnectionsPerHost(1000);
params.setMaxTotalConnections(1000);
client = new HttpClient( httpConnectionManager);
PostMethod post = new PostMethod(URL + URLEncoder.encode(alarmMsgInfo, "GBK"));
client.executeMethod(post);
但是用 restTemplate 就不行 发的是 %C4%E3%BA%C3