private String convertRequestToString() throws IOException {
    InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
    BufferedReader bufferedReader = new BufferedReader(inputStreamReader);

    StringBuilder requestBuilder = new StringBuilder();
    String line;
    try {
      do {
        line = bufferedReader.readLine();
        requestBuilder.append(line);
        if (line.equals("")) break;
      } while (bufferedReader.ready());
    } catch (Exception e) {
      System.out.println("Request could not be read");
    }

    return requestBuilder.toString();
  }