sample code as below.
Unirest.config().verifySsl(false);
HttpResponse<JsonNode> response = Unirest
.post(CF_RESTAPI_URL + "/content/" + contentId + "/child/attachment/" + fileId + "/data")
.basicAuth(CF_RESTAPI_ACCOUNT, CF_RESTAPI_PASSWORD)
.header("X-Atlassian-Token", "no-check")
.field("file", new File(filePath))
.field("minorEdit", "true")
.field("comment", "Example attachment comment測試123", "text/plain; charset=UTF-8")
.asJson();