GetMethod get = new GetMethod("/xxx/user"); | |
get.addRequestHeader("accept", "application/xml"); // 视具体情况而定,可以从浏览器或 postman 查看下请求的 header | |
get.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"utf-8"); // 这里设置具体编码,视具体接口而定 |
参考: https://www.cnblogs.com/yixiu868/p/6637645.html