static HttpRequest postRequest()

in buildSrc/src/main/groovy/HttpUtil.groovy [59:67]


    static HttpRequest postRequest(url, String json, user, password) {
        def body = HttpRequest.BodyPublishers.ofString(json)
        HttpRequest.newBuilder()
                .uri(new URI(url))
                .header('Authorization', 'Basic ' + "$user:$password".getBytes('iso-8859-1').encodeBase64())
                .header('Content-Type', 'application/json')
                .POST(body)
                .build()
    }