code:     private static void post(JenkinsRule.WebClient webClient, String relative,
                               String expectedContentType, Integer expectedStatus) throws IOException {
          WebRequest request = new WebRequest(
                  UrlUtils.toUrlUnsafe(webClient.getContextPath() + relative),
                  HttpMethod.POST);
          try {
              Page p = webClient.getPage(request);
              if (expectedContentType != null) {
                  assertThat(p.getWebResponse().getContentType(), is(expectedContentType));
              }
          } catch (FailingHttpStatusCodeException e) {
              if (expectedStatus != null) {
                  assertEquals(expectedStatus.intValue(), e.getStatusCode());
              } else {
                  throw e;
              }
          }
      }
  