HttpPost postRequest = new HttpPost("http://example.com/upload");
File file = new File("path/to/file");
FileEntity fileEntity = new FileEntity(file);
postRequest.setEntity(fileEntity);
HttpClient httpClient = HttpClientBuilder.create().build();
HttpResponse response = httpClient.execute(postRequest);
int statusCode = response.getStatusLine().getStatusCode();
String responseBody = EntityUtils.toString(response.getEntity());