} else if (request.getStringData() != null) {
nettyBody = new NettyByteArrayBody(request.getStringData().getBytes(bodyCharset));
} else if (request.getStreamData() != null) {
nettyBody = new NettyInputStreamBody(request.getStreamData());
} else if (isNonEmpty(request.getFormParams())) {
String contentType = null;
if (!request.getHeaders().containsKey(HttpHeaders.Names.CONTENT_TYPE))
contentType = HttpHeaders.Values.APPLICATION_X_WWW_FORM_URLENCODED;
nettyBody = new NettyByteArrayBody(computeBodyFromParams(request.getFormParams(), bodyCharset), contentType);
} else if (isNonEmpty(request.getParts())) {
nettyBody = new NettyMultipartBody(request.getParts(), request.getHeaders(), nettyConfig);
} else if (request.getFile() != null) {
nettyBody = new NettyFileBody(request.getFile(), nettyConfig);
} else if (request.getBodyGenerator() instanceof FileBodyGenerator) {
FileBodyGenerator fileBodyGenerator = (FileBodyGenerator) request.getBodyGenerator();
nettyBody = new NettyFileBody(fileBodyGenerator.getFile(), fileBodyGenerator.getRegionSeek(), fileBodyGenerator.getRegionLength(), nettyConfig);
} else if (request.getBodyGenerator() instanceof InputStreamBodyGenerator) {
nettyBody = new NettyInputStreamBody(InputStreamBodyGenerator.class.cast(request.getBodyGenerator()).getInputStream());
} else if (request.getBodyGenerator() != null) {
nettyBody = new NettyBodyBody(request.getBodyGenerator().createBody(), nettyConfig);
}
}