httpclient4 post 请求乱码

HttpPost post=new HttpPost(url);
StringEntity content=new StringEntity(data, Charset.forName("utf-8"));// 第二个参数,设置后才会对,内容进行编码

content.setContentType("application/json; charset=UTF-8");
content.setContentEncoding("utf-8");
post.setEntity(content);


你可能感兴趣的:(post,httpclient4)