code: private void addHeadersToRequest(HttpRequestBase httpRequest, Request<?> request) {
  
          httpRequest.addHeader(HttpHeaders.HOST, getHostHeaderValue(request.getEndpoint()));
  
          // 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 (!(ignoreHeaders.contains(entry.getKey()))) {
                  httpRequest.addHeader(entry.getKey(), entry.getValue());
              }
          }
  
          /* Set content type and encoding */
          if (httpRequest.getHeaders(HttpHeaders.CONTENT_TYPE) == null || httpRequest
                  .getHeaders
                          (HttpHeaders.CONTENT_TYPE).length == 0) {
              httpRequest.addHeader(HttpHeaders.CONTENT_TYPE,
                      "application/x-www-form-urlencoded; " +
                              "charset=" + DEFAULT_ENCODING.toLowerCase());
          }
      }
docs: Configures the headers in the specified Apache HTTP request.