nettyRequest.setHeader(header.getKey(), header.getValue());
}
//
// set body
BodyGenerator bodyGenerator = request.getBodyGenerator();
if (bodyGenerator != null) {
DynamicChannelBuffer content = new DynamicChannelBuffer(64 * 1024);
ChannelBufferOutputStream out = new ChannelBufferOutputStream(content);
bodyGenerator.write(out);
nettyRequest.setHeader(Names.CONTENT_LENGTH, content.readableBytes());
nettyRequest.setContent(content);
}
return nettyRequest;