ByteArrayOutputStream httpRequest = new ByteArrayOutputStream();
addHttpMethod(httpRequest, verb, uri);
appendHeaders(httpRequest, headers);
appendEntity(httpRequest, new ByteArrayInputStream(bytes));
DataSource bodyPartContent = new InputStreamDataSource(
new ByteArrayInputStream(httpRequest.toByteArray()),
"application/http");
return bodyPartContent;
}