@Override
    protected void formatMultipartHeader(
            final MultipartPart part,
            final OutputStream out) throws IOException {
        // For browser-compatible, only write Content-Disposition
        // Use content charset
        final Header header = part.getHeader();
        final MimeField cd = header.getField(MimeConsts.CONTENT_DISPOSITION);
        if (cd != null) {
            writeField(cd, this.charset, out);
        }
        final String filename = part.getBody().getFilename();
        if (filename != null) {
            final MimeField ct = header.getField(MimeConsts.CONTENT_TYPE);
            writeField(ct, this.charset, out);
        }

    }
Write the multipart header fields; depends on the style.
httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/LegacyMultipart.java