code: private void writeRequest0(final NextFilter nextFilter,
              final HttpProxyRequest request) {
          try {
              String data = request.toHttpString();
              IoBuffer buf = IoBuffer.wrap(data.getBytes(getProxyIoSession()
                      .getCharsetName()));
  
              LOGGER.debug("   write:\n{}", data.replace("\r", "\\r").replace(
                      "\n", "\\n\n"));
  
              writeData(nextFilter, buf);
  
          } catch (UnsupportedEncodingException ex) {
              closeSession("Unable to send HTTP request: ", ex);
          }
      }
docs: Encodes a HTTP request and sends it to the proxy server.
  
  @param nextFilter the next filter
  @param request the http request