Commit 670fdff5 zshaohui

1053增加响应格式为 json

1 个父辈 c1a7839c
...@@ -38,6 +38,7 @@ public class HttpHelper { ...@@ -38,6 +38,7 @@ public class HttpHelper {
public static String postJson(String url, Map<String, Object> params) throws ApiException { public static String postJson(String url, Map<String, Object> params) throws ApiException {
HttpPost httpPost = new HttpPost(url); HttpPost httpPost = new HttpPost(url);
httpPost.addHeader("Content-Type", "application/json;charset=utf-8"); httpPost.addHeader("Content-Type", "application/json;charset=utf-8");
httpPost.addHeader("Accept", "application/json;charset=utf-8");
// 设置请求参数 // 设置请求参数
if (params != null && !params.isEmpty()) { if (params != null && !params.isEmpty()) {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!