public String sendRequestToServer(String requestBody) throws HttpClientException {
        Socket socket;
        String contentLengthHeader = "Content-Length: " + requestBody.length();
        String request = REQUEST_HEADERS + contentLengthHeader + "\r\n\r\n" + requestBody;

        try {
            socket = new Socket(connectionHost, connectionPort);
            socket.getOutputStream().write(request.getBytes());
        } catch (IOException e) {
            throw new HttpClientException("Unable to connect to server", e);
        }

        String response = new String();
        try {
            InputStream inputStream = socket.getInputStream();
            BufferedReader responseReader = new BufferedReader(new InputStreamReader(inputStream));
            String line;
            while ((line = responseReader.readLine()) != null) {
                response += line + "\r\n";
            }
            responseReader.close();
            socket.close();
        } catch (IOException e) {
            throw new HttpClientException("Unable to receive a response from server", e);
        }

        int responseTagStartPosition = response.indexOf(RESPONSE_TAG);
        if (responseTagStartPosition == -1) {
            throw new HttpClientException("Invalid response");
        }

        int responseTagEndPosition = responseTagStartPosition + RESPONSE_TAG.length();
        String responseString = response.substring(responseTagEndPosition).trim();

        return responseString;
    }