private WebResponse performYamlValidation(JenkinsConfiguredWithCodeRule j, String yamlContent) throws Exception {
        URL apiURL = new URL(MessageFormat.format(
                "{0}configuration-as-code/check", j.getURL().toString()));
        WebRequest request = new WebRequest(apiURL, HttpMethod.POST);
        request.setCharset(StandardCharsets.UTF_8);
        request.setRequestBody(yamlContent);

        WebClient client = j.createWebClient();
        // Don't throw exceptions for error status codes
        client.getOptions().setThrowExceptionOnFailingStatusCode(false);

        return client.getPage(request).getWebResponse();
    }
Helper method to perform YAML validation.
test-harness/src/test/java/io/jenkins/plugins/casc/YamlValidationTest.java