当前位置: 代码迷 >> JavaScript >> 解决HttpClient交付json格式请求的中文支持
  详细解决方案

解决HttpClient交付json格式请求的中文支持

热度:261   发布时间:2012-10-21 09:00:08.0
解决HttpClient提交json格式请求的中文支持
解决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();

  相关解决方案