App.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:scouter-pulse 作者:
private static int registerMetadata() throws UnirestException {
    JSONObject rootJson = new JSONObject();
    JSONObject objectJson = new JSONObject();
    objectJson.put("type", "website");
    objectJson.put("display", "Web");
    rootJson.put("object", objectJson);
    JSONArray counterArray = new JSONArray();
    rootJson.put("counters", counterArray);
JSONObject counterMap = new JSONObject();
counterArray.put(counterMap);
counterMap.put("name", "Time");
counterMap.put("unit", "ms");

    HttpResponse<JsonNode> response = Unirest.post("http://" + ip + ":" + port + "/register")
    .header("accept", "application/json")
    .header("content-type", "application/json")
    .body(rootJson).asJson();

    return response.getStatus();
  }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号