/**
* Create a post request encapsulating bytes from the given
* ByteArrayOutputStream.
*/
private HttpPost setupRequest(ByteArrayOutputStream bos) {
ContentBody cb = new ByteArrayBody(bos.toByteArray(), "image");
HttpPost postRequest = new HttpPost(uri + "/uploadImage");
MultipartEntity reqEntity = new MultipartEntity(
HttpMultipartMode.BROWSER_COMPATIBLE);
// add a single part to the request