code: public static String httpRequest(String stringUrl, String method, Map<String, String> parameters,
        String input, String charset) throws IOException {
      URL url = new URL(stringUrl);
      HttpURLConnection conn = (HttpURLConnection) url.openConnection();
      conn.setDoOutput(true);
      conn.setRequestMethod(method);
  
      if (parameters != null) {
        for (Entry<String, String> entry : parameters.entrySet()) {
          conn.addRequestProperty(entry.getKey(), entry.getValue());
        }
      }
  
      if (input != null) {
        OutputStream output = null;
        try {
          output = conn.getOutputStream();
          output.write(input.getBytes(charset));
        } finally {
          if (output != null) {
            output.close();
          }
        }
      }
  
      return MyStreamUtils.readContent(conn.getInputStream());
    }
docs: Execute a HTTP request
  
  @param stringUrl URL
  @param method Method to use
  @param parameters Params
  @param input Input / Payload
  @param charset Input Charset
  @return response
  @throws IOException