This content has been marked as final.
Show 2 replies
-
1. Re: encoding problem
ctomc May 17, 2017 5:43 AM (in response to wenfeng.he)configure url-charset on http-listener (or any others you are using)
-
I use wildfly10.
HttpClient client = HttpClientBuilder.create().build();
HttpPost httppost = new HttpPost("http://127.0.0.1:28080/DPMS/accessTest");
StringEntity postingString = new StringEntity("itemTitle=测试商品请不要拍",Charset.forName("utf-8"));
try {
httppost.setEntity(postingString);
httppost.setHeader("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
HttpResponse response = client.execute(httppost);
}catch (Exception e) {
}
But in jboss-as-7.1.1.Final and tomcat8 ,it's ok.
configure url-charset on http-listener (or any others you are using)