code: public <T> Response<T> post(Endpoint endpoint, File file, Class<T> responseClass) throws IOException {
          if (file == null) {
              return post(endpoint, responseClass);
          } // deal with null case
  
          // Create the request
          HttpPost post = new HttpPost(endpoint.url());
          post.setHeaders(combineHeaders());
  
          // Add fields as text pairs
          MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
          // Add file as binary
          FileBody bin = new FileBody(file);
          multipartEntityBuilder.addPart("file", bin);
  
          // Set the body
          post.setEntity(multipartEntityBuilder.build());
  
          // Send the request and process the response
          try (CloseableHttpResponse response = httpClient().execute(post)) {
              T body = deserialiseResponseMessage(response, responseClass);
              return new Response<>(response.getStatusLine(), body);
          }
      }
docs: Sends a POST request with a file and returns the response.
  
  @param endpoint      The endpoint to send the request to.
  @param file          The file to upload
  @param responseClass The class to deserialise the Json response to. Can be null if no response message is expected.
  @param <T>           The type to deserialise the response to.
  @return A {@link Response} containing the deserialised body, if any.
  @throws IOException If an error occurs.
  @see MultipartEntityBuilder