| | |
| | | try { |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(requestUrl) |
| | | .setPath("/test") |
| | | .setPath("/static/readStatus.json") |
| | | .setJson(JSON.toJSONString(httpCommand)) |
| | | .build() |
| | | .doPost(); |
| | | .doGet(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | JSONObject request = jsonObject.getJSONObject("request"); |
| | | JSONObject body = request.getJSONObject("body"); |
| | | if (body.get("result").equals("success")) { |
| | | JSONObject response2 = jsonObject.getJSONObject("response"); |
| | | JSONObject body = response2.getJSONObject("body"); |
| | | |
| | | if (body.get("responseType").equals("state")) {//读取状态,不需要判断success |
| | | return body; |
| | | } |
| | | |
| | | if (body.get("result").equals("success")) { |
| | | return body; |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | // e.printStackTrace(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |