code: @Override
      public <R extends BaseModel, D> R post(String path, D data, Class<R> cls, Map<String, File> fileParams, boolean crumbFlag) throws IOException {
          HttpPost request = new HttpPost(UrlUtils.toJsonApiUri(uri, context, path));
          handleCrumbFlag(crumbFlag, request);
  
          if (data != null) {
              String value = mapper.writeValueAsString(data);
              StringEntity stringEntity = new StringEntity(value, ContentType.APPLICATION_JSON);
              request.setEntity(stringEntity);
          }
  
          // Prepare file parameters
          if(fileParams != null && !(fileParams.isEmpty())) {
              MultipartEntityBuilder builder = MultipartEntityBuilder.create();
              builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
  
              for (Map.Entry<String, File> entry : fileParams.entrySet()) {
                  FileBody fileBody = new FileBody(entry.getValue());
                  builder.addPart(entry.getKey(), fileBody);
              }
  
              HttpEntity entity = builder.build();
              request.setEntity(entity);
          }
  
          HttpResponse response = client.execute(request, localContext);
          jenkinsVersion = ResponseUtils.getJenkinsVersion(response);
  
          try {
              httpResponseValidator.validateResponse(response);
  
              if (cls != null) {
                  R responseObject;
                  if (cls.equals(ExtractHeader.class)) {
                      ExtractHeader location = new ExtractHeader();
                      location.setLocation(response.getFirstHeader("Location").getValue());
                      responseObject = (R) location;
                  } else {
                      responseObject = objectFromResponse(cls, response);
                  }
                  return responseObject;
              } else {
                  return null;
              }
          } finally {
              EntityUtils.consume(response.getEntity());
              releaseConnection(request);
          }
      }
docs: {@inheritDoc}