HttpResult post()

in src/main/java/com/googlesource/gerrit/plugins/webhooks/HttpSession.java [49:60]


  HttpResult post(RemoteConfig remote, EventProcessor.Request request) throws IOException {
    HttpPost post = new HttpPost(remote.getUrl());
    post.addHeader("Content-Type", MediaType.JSON_UTF_8.toString());
    post.setConfig(getConfig(remote));
    request.headers.entrySet().stream()
        .forEach(
            e -> {
              post.addHeader(e.getKey(), e.getValue());
            });
    post.setEntity(new StringEntity(request.body, StandardCharsets.UTF_8));
    return httpClient.execute(post, new HttpResponseHandler());
  }