code: public ItemRequest<Attachment> createOnTask(String task, InputStream fileContent, String fileName, String fileType) {
          MultipartContent.Part part = new MultipartContent.Part()
                  .setContent(new InputStreamContent(fileType, fileContent))
                  .setHeaders(new HttpHeaders().set(
                          "Content-Disposition",
                          String.format("form-data; name=\"file\"; filename=\"%s\"", fileName) // TODO: escape fileName?
                  ));
          MultipartContent content = new MultipartContent()
                  .setMediaType(new HttpMediaType("multipart/form-data").setParameter("boundary", UUID.randomUUID().toString()))
                  .addPart(part);
  
          String path = String.format("/tasks/%s/attachments", task);
          return new ItemRequest<Attachment>(this, Attachment.class, path, "POST")
                  .data(content);
      }
docs: Upload a file and attach it to a task
  
  @param task        Globally unique identifier for the task.
  @param fileContent Content of the file to be uploaded
  @param fileName    Name of the file to be uploaded
  @param fileType    MIME type of the file to be uploaded
  @return Request object