HTTPClient PostMethod 中文乱码处理
2014-02-11 10:33
459 查看
HttpClient client = new HttpClient(); PostMethod post=null; String info=""; try { post = new PostMethod("http://192.168.11.178/SMSCore/sendSMS.do"); NameValuePair[] postdata = new NameValuePair[4]; postdata[0] = new NameValuePair("telephone",this.receivers ); postdata[1] = new NameValuePair("message",this.content ); postdata[2] = new NameValuePair("system","console" ); postdata[3] = new NameValuePair("sysPassword","123"); post.addRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");//关键代码 post.addParameters(postdata); int state = client.executeMethod(post); String html=post.getResponseBodyAsString(); setAjax_out_data(new ByteArrayInputStream(html.getBytes("UTF-8"))); } catch (Exception e) { e.printStackTrace(); }finally{ post.releaseConnection(); }
相关文章推荐
- HTTPClient PostMethod 中文乱码问题解决方案
- HttpClient使用Post和Get提交参数 中文乱码处理
- JAVA HTTPClient PostMethod 中文乱码问题解决方法
- httpclient 4.3.x 版本 post 中文乱码问题
- httpclient上传图片与参数,处理中文乱码
- HttpClient post中文乱码解决
- httpclient get和post,中文乱码已解决
- httpclient中getmethod方法的url参数如果含有中文的处理办法
- http 的post与get方法 以及处理中文乱码问题
- httpclient3解决post中文乱码
- HttpClient用HttpPost传输中文字符串乱码
- HTTPClient POST发送JSON数据 中文无乱码
- httpclient post 上传文件及参数包括中文乱码问题方案
- HttpClient Post和Get请求实例+ 中文参数处理
- HttpClient使用post和get时Json中文乱码解决方案
- Spring学习笔记(三十五):关于httpClient的post请求,到后台中文乱码的问题
- HttpClient get和post请求的示例代码以及防乱码处理
- 关于httpclient3 postMethod乱码问题解决方法
- HttpClient 处理中文乱码
- HttpClient 处理中文乱码