public void handle(HttpExchange exchange) throws IOException {
            String requestMethod = exchange.getRequestMethod();
            if (!"POST".equals(requestMethod)) {
                exchange.sendResponseHeaders(HttpURLConnection.HTTP_BAD_METHOD, 0);
                exchange.close();
                return;
            }

            InputStream inputStream = exchange.getRequestBody();
            BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
            String requestBody = "";
            String line;

            while ((line = reader.readLine()) != null) {
                requestBody += line;
            }
            requestBody = requestBody.trim();
            inputStream.close();

            String responseString;
            if (CONNECTION_TEST_MESSAGE.equals(requestBody)) {
                responseString = RESPONSE_TAG + " " + CONNECTION_SUCCESS_MESSAGE;
            } else {
                responseString = RESPONSE_TAG + " " + executeCommand(requestBody);
            }

            Headers responseHeaders = exchange.getResponseHeaders();
            responseHeaders.add("Content-Type", "text/html");
            responseHeaders.add("Content-Length", Integer.toString(responseString.length()));
            exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, responseString.length() * 2);

            OutputStream outputStream = exchange.getResponseBody();
            outputStream.write(responseString.getBytes());
            outputStream.close();
            exchange.close();
        }