use of cn.hutool.http.HttpRequest in project Jpom by dromara.
the class BuildTriggerTest method test.
@Test
public void test() {
// 8cf594526db74f0eb79cac6da141c655/219a4009a0a68173d8d643d237f2ca8ad797d41dc5bcfceb83da4f4f1d1dbe933a1
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", "8cf594526db74f0eb79cac6da141c655");
jsonObject.put("token", "219a4009a0a68173d8d643d237f2ca8ad797d41dc5bcfceb83da4f4f1d1dbe933a1");
//
JSONArray jsonArray = new JSONArray();
jsonArray.add(jsonObject);
//
HttpRequest post = HttpUtil.createPost("http://127.0.0.1:2122/" + ServerOpenApi.BUILD_TRIGGER_BUILD_BATCH);
post.body(jsonArray.toString(), MediaType.APPLICATION_JSON_VALUE);
String body = post.execute().body();
System.out.println(body);
}
Aggregations