docs: protected HttpRequestBase createHttpRequest(InternalRequest request) {
          String uri = request.getUri().toASCIIString();
          String encodedParams = HttpUtils.getCanonicalQueryString(request.getParameters(), false);
  
          if (encodedParams.length() > 0) {
              uri += "?" + encodedParams;
          }
  
          HttpRequestBase httpRequest;
          long contentLength = -1;
          String contentLengthString = request.getHeaders().get(Headers.CONTENT_LENGTH);
          if (contentLengthString != null) {
              contentLength = Long.parseLong(contentLengthString);
          }
          if (request.getHttpMethod() == HttpMethodName.GET) {
              httpRequest = new HttpGet(uri);
          } else if (request.getHttpMethod() == HttpMethodName.PUT) {
              HttpPut putMethod = new HttpPut(uri);
              httpRequest = putMethod;
              if (request.getContent() != null) {
                  putMethod.setEntity(new InputStreamEntity(request.getContent(), contentLength));
              }
          } else if (request.getHttpMethod() == HttpMethodName.POST) {
              HttpPost postMethod = new HttpPost(uri);
              httpRequest = postMethod;
              if (request.getContent() != null) {
                  postMethod.setEntity(new InputStreamEntity(request.getContent(), contentLength));
              }
          } else if (request.getHttpMethod() == HttpMethodName.DELETE) {
              httpRequest = new HttpDelete(uri);
          } else if (request.getHttpMethod() == HttpMethodName.HEAD) {
              httpRequest = new HttpHead(uri);
          } else {
              throw new BceClientException("Unknown HTTP method name: " + request.getHttpMethod());
          }
  
          httpRequest.addHeader(Headers.HOST, HttpUtils.generateHostHeader(request.getUri()));
  
          // Copy over any other headers already in our request
          for (Entry<String, String> entry : request.getHeaders().entrySet()) {
              /*
               * HttpClient4 fills in the Content-Length header and complains if it's already present, so we skip it here.
               * We also skip the Host header to avoid sending it twice, which will interfere with some signing schemes.
               */
              if (entry.getKey().equalsIgnoreCase(Headers.CONTENT_LENGTH)
                      || entry.getKey().equalsIgnoreCase(Headers.HOST)) {
                  continue;
              }
  
              httpRequest.addHeader(entry.getKey(), entry.getValue());
          }
  
          checkNotNull(httpRequest.getFirstHeader(Headers.CONTENT_TYPE), Headers.CONTENT_TYPE + " not set");
          return httpRequest;
      }