code: public Response makeRequest(final Request request) {
  
          HttpMethod method = request.getMethod();
          RequestBuilder builder = RequestBuilder.create(method.toString())
              .setUri(request.constructURL().toString())
              .setVersion(HttpVersion.HTTP_1_1)
              .setCharset(StandardCharsets.UTF_8);
  
          if (request.requiresAuthentication()) {
              builder.addHeader(HttpHeaders.AUTHORIZATION, request.getAuthString());
          }
  
          if (method == HttpMethod.POST) {
              builder.addHeader(HttpHeaders.CONTENT_TYPE, "application/x-www-form-urlencoded");
  
              for (Map.Entry<String, List<String>> entry : request.getPostParams().entrySet()) {
                  for (String value : entry.getValue()) {
                      builder.addParameter(entry.getKey(), value);
                  }
              }
          }
  
          HttpResponse response = null;
  
          try {
              response = client.execute(builder.build());
              HttpEntity entity = response.getEntity();
              return new Response(
                  // Consume the entire HTTP response before returning the stream
                  entity == null ? null : new BufferedHttpEntity(entity).getContent(),
                  response.getStatusLine().getStatusCode()
              );
          } catch (IOException e) {
              throw new ApiException(e.getMessage(), e);
          } finally {
  
              // Ensure this response is properly closed
              HttpClientUtils.closeQuietly(response);
  
          }
  
      }
docs: Make a request.
  
  @param request request to make
  @return Response of the HTTP request