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);
时间: 2024-10-08 16:31:16