解决HttpClient提交json格式请求的乱码
PostMethod postMethod = new PostMethod(url);
RequestEntity requestEntity = new StringRequestEntity(requestData,""text/xml"","gbk")
postMethod.setRequestEntity(requestEntity);
int httpReturnCold = httpClient.executeMethod(postMethod);
String responseBody = postMethod.getResponseBodyAsString();
本文介绍了一种解决使用HttpClient提交JSON格式请求时出现乱码的方法。通过设置PostMethod及RequestEntity参数,确保数据正确传输。
1533

被折叠的 条评论
为什么被折叠?



