code: HttpResponse _doHttpRequest(RequestType requestType, String url, String json) throws IOException {
          StringEntity entity = null;
  
          if (json != null) {
              entity = new StringEntity(json, StandardCharsets.UTF_8.name());
              entity.setContentEncoding(StandardCharsets.UTF_8.name());
              entity.setContentType(ContentType.APPLICATION_JSON.getMimeType());
          }
          switch (requestType) {
              case POST:
  
                  HttpPost post = new HttpPost(url);
                  post.setEntity(entity);
  
                  post.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
                  return _httpClient.execute(post, _httpContext);
              case GET:
  
                  HttpGet httpGet = new HttpGet(url);
                  
                  httpGet.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
                  return _httpClient.execute(httpGet, _httpContext);
              case DELETE:
  
                  HttpDelete httpDelete = new HttpDelete(url);
                  
                  httpDelete.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
                  return _httpClient.execute(httpDelete, _httpContext);
              case PUT:
  
                  HttpPut httpput = new HttpPut(url);
  
                  httpput.setEntity(entity);
                  httpput.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
                  return _httpClient.execute(httpput, _httpContext);
              default:
                  throw new IllegalArgumentException(" Request Type " + requestType + " not a valid request type. ");
          }
      }
docs: /* The actual request call.  Factored for test mocking.