docs: protected void writeRequest(HttpState state, HttpConnection conn)
      throws IOException, HttpException {
          LOG.trace(
              "enter HttpMethodBase.writeRequest(HttpState, HttpConnection)");
          writeRequestLine(state, conn);
          writeRequestHeaders(state, conn);
          conn.writeLine(); // close head
          if (Wire.HEADER_WIRE.enabled()) {
              Wire.HEADER_WIRE.output("\r\n");
          }
  
          HttpVersion ver = getParams().getVersion();
          Header expectheader = getRequestHeader("Expect");
          String expectvalue = null;
          if (expectheader != null) {
              expectvalue = expectheader.getValue();
          }
          if ((expectvalue != null) 
           && (expectvalue.compareToIgnoreCase("100-continue") == 0)) {
              if (ver.greaterEquals(HttpVersion.HTTP_1_1)) {
  
                  // make sure the status line and headers have been sent
                  conn.flushRequestOutputStream();
                  
                  int readTimeout = conn.getParams().getSoTimeout();
                  try {
                      conn.setSocketTimeout(RESPONSE_WAIT_TIME_MS);
                      readStatusLine(state, conn);
                      processStatusLine(state, conn);
                      readResponseHeaders(state, conn);
                      processResponseHeaders(state, conn);
  
                      if (this.statusLine.getStatusCode() == HttpStatus.SC_CONTINUE) {
                          // Discard status line
                          this.statusLine = null;
                          LOG.debug("OK to continue received");
                      } else {
                          return;
                      }
                  } catch (InterruptedIOException e) {
                      if (!ExceptionUtil.isSocketTimeoutException(e)) {
                          throw e;
                      }
                      // Most probably Expect header is not recongnized
                      // Remove the header to signal the method 
                      // that it's okay to go ahead with sending data
                      removeRequestHeader("Expect");
                      LOG.info("100 (continue) read timeout. Resume sending the request");
                  } finally {
                      conn.setSocketTimeout(readTimeout);
                  }
                  
              } else {
                  removeRequestHeader("Expect");
                  LOG.info("'Expect: 100-continue' handshake is only supported by "
                      + "HTTP/1.1 or higher");
              }
          }
  
          writeRequestBody(state, conn);
          // make sure the entire request body has been sent
          conn.flushRequestOutputStream();
      }