try {
HttpPost httpPost = new HttpPost ("https://styleai.io/api/api/v1/studios/change_face");
HttpEntity multipartEntity = MultipartEntityBuilder.create()
.addTextBody("token", token)
.addBinaryBody("input_image_file", new File(imageFilePath))
.addBinaryBody("masking_image_file", new File(maskFilePath))
.addBinaryBody("face_image_file", new File(faceImageFilePath))
.build();
httpPost.setEntity(multipartEntity);
HttpResponse response = httpClient.execute(httpPost);
System.out.println("Response Code: " + response.getStatusLine().getStatusCode());
System.out.println("Response Body: " + EntityUtils.toString(response.getEntity())); } finally {
httpClient.close();
}