code: @SuppressWarnings("deprecation")
      /* protected */ static HttpUriRequest createHttpRequest(Request<?> request,
              Map<String, String> additionalHeaders) throws AuthFailureError {
          switch (request.getMethod()) {
              case Method.DEPRECATED_GET_OR_POST: {
                  // This is the deprecated way that needs to be handled for backwards compatibility.
                  // If the request's post body is null, then the assumption is that the request is
                  // GET.  Otherwise, it is assumed that the request is a POST.
                  byte[] postBody = request.getPostBody();
                  if (postBody != null) {
                      HttpPost postRequest = new HttpPost(request.getUrl());
                      postRequest.addHeader(HEADER_CONTENT_TYPE, request.getPostBodyContentType());
                      HttpEntity entity;
                      entity = new ByteArrayEntity(postBody);
                      postRequest.setEntity(entity);
                      return postRequest;
                  } else {
                      return new HttpGet(request.getUrl());
                  }
              }
              case Method.GET:
                  return new HttpGet(request.getUrl());
              case Method.DELETE:
                  return new HttpDelete(request.getUrl());
              case Method.POST: {
                  HttpPost postRequest = new HttpPost(request.getUrl());
                  postRequest.addHeader(HEADER_CONTENT_TYPE, request.getBodyContentType());
                  setEntityIfNonEmptyBody(postRequest, request);
                  return postRequest;
              }
              case Method.PUT: {
                  HttpPut putRequest = new HttpPut(request.getUrl());
                  putRequest.addHeader(HEADER_CONTENT_TYPE, request.getBodyContentType());
                  setEntityIfNonEmptyBody(putRequest, request);
                  return putRequest;
              }
              case Method.HEAD:
                  return new HttpHead(request.getUrl());
              case Method.OPTIONS:
                  return new HttpOptions(request.getUrl());
              case Method.TRACE:
                  return new HttpTrace(request.getUrl());
              case Method.PATCH: {
                  HttpPatch patchRequest = new HttpPatch(request.getUrl());
                  patchRequest.addHeader(HEADER_CONTENT_TYPE, request.getBodyContentType());
                  setEntityIfNonEmptyBody(patchRequest, request);
                  return patchRequest;
              }
              default:
                  throw new IllegalStateException("Unknown request method.");
          }
      }
docs: Creates the appropriate subclass of HttpUriRequest for passed in request.