urlConnection.setRequestProperty("Content-Type", mre.getContentType());
urlConnection.setRequestProperty("Content-Length", String.valueOf(mre.getContentLength()));
ChannelBuffer b = ChannelBuffers.dynamicBuffer(lenght);
mre.writeRequest(urlConnection.getOutputStream());
} else if (request.getEntityWriter() != null) {
int lenght = (int) request.getContentLength();
if (lenght != -1) {
urlConnection.setRequestProperty("Content-Length", String.valueOf(lenght));
urlConnection.setFixedLengthStreamingMode(lenght);