| | |
| | |
|
| | | private static JsonObject doPost(String url, Map<String, Object> map, int timeOut) throws BusinessException {
|
| | | Gson gson = new Gson();
|
| | | map.put("homeId", LCDeviceEngine.newInstance().getHomeId());
|
| | | String json;
|
| | | JsonObject jsonObject;
|
| | | if(CONST.isHdlServer()) {
|
| | | map.put("homeId", LCDeviceEngine.newInstance().getHomeId());
|
| | | if (map.containsKey("params")) {
|
| | | Map<String, Object> tempMap = (Map<String, Object>) map.get("params");
|
| | | map.remove("params");
|
| | |
| | | try {
|
| | | LogUtil.debugLog(TAG, "reqest: " + url + " data:" + json);
|
| | | String openApi = HttpClient.post(url, json, "application/json", "OpenApi",timeOut);
|
| | | LogUtil.debugLog(TAG, "返回结果: \r\n" + openApi);
|
| | | jsonObject = new JsonParser().parse(openApi).getAsJsonObject();
|
| | | } catch (IOException e) {
|
| | | BusinessException b = new BusinessException(e);
|