code: protected void writeRequestHeaders(HttpState state, HttpConnection conn)
      throws IOException, HttpException {
          LOG.trace("enter HttpMethodBase.writeRequestHeaders(HttpState,"
              + "HttpConnection)");
          addRequestHeaders(state, conn);
  
          String charset = getParams().getHttpElementCharset();
          
          Header[] headers = getRequestHeaders();
          for (int i = 0; i < headers.length; i++) {
              String s = headers[i].toExternalForm();
              if (Wire.HEADER_WIRE.enabled()) {
                  Wire.HEADER_WIRE.output(s);
              }
              conn.print(s, charset);
          }
      }
docs: Writes the request headers to the given {@link HttpConnection connection}.
  
  <p>
  This implementation invokes {@link #addRequestHeaders(HttpState,HttpConnection)},
  and then writes each header to the request stream.
  </p>
  
  <p>
  Subclasses may want to override this method to to customize the
  processing.
  </p>
  
  @param state the {@link HttpState state} information associated with this method
  @param conn the {@link HttpConnection connection} used to execute
  this HTTP method
  
  @throws IOException if an I/O (transport) error occurs. Some transport exceptions
  can be recovered from.
  @throws HttpException  if a protocol exception occurs. Usually protocol exceptions
  cannot be recovered from.
  
  @see #addRequestHeaders
  @see #getRequestHeaders