| | |
| | | return httpEntity; |
| | | } |
| | | |
| | | //map类型使用 |
| | | public static HttpEntity setEntity2(Map<String, Object> map) { |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // headers.setContentType(MediaType.parseMediaType("application/json; charset=UTF-8")); |
| | | headers.add("Tenant-Id","1"); |
| | | headers.add("isToken","false"); |
| | | headers.add("Authorization","Basic YXBwOmFwcA=="); |
| | | ReturnData returnData = new ReturnData(); |
| | | try { |
| | | if (map != null) { |
| | | HttpEntity<Map<String, Object>> httpEntity = new |
| | | HttpEntity<>(map, headers); |
| | | return httpEntity; |
| | | } |
| | | } catch (Exception e) { |
| | | returnData.setCode(-1); |
| | | returnData.setMsg("系统内部出错!FASP-HESSIAN-1001: 请求 网关出现异常!"); |
| | | } |
| | | HttpEntity<String> httpEntity = new HttpEntity<>(headers); |
| | | return httpEntity; |
| | | } |
| | | |
| | | //list类型使用 |
| | | public static HttpEntity setEntityForList(List<Map<String, Object>> list){ |
| | | HttpHeaders headers = new HttpHeaders(); |