{
String charset = MimeTypes.getCharsetFromContentType(_contentType);
if(charset!=null)
_charset = charset;
}
Buffer bb=new ByteArrayBuffer(32*1024 + (_genContent!=null?_genContent.length:0));
Buffer sb=new ByteArrayBuffer(4*1024);
StringEndPoint endp = new StringEndPoint(_charset);
HttpGenerator generator = new HttpGenerator(new SimpleBuffers(new Buffer[]{sb,bb}),endp, sb.capacity(), bb.capacity());
if (_method!=null)
{
generator.setRequest(getMethod(),getURI());
if (_version==null)