code: public static String readBody(HttpServletRequest request) {
  
          BufferedReader input = null;
          try {
              input = new BufferedReader(new InputStreamReader(request.getInputStream()));
              StringBuilder builder = new StringBuilder();
              String buffer;
              while ((buffer = input.readLine()) != null) {
                  if (builder.length() > 0) {
                      builder.append("\n");
                  }
                  builder.append(buffer);
              }
              return builder.toString();
          } catch (IOException e) {
              log.info("http io exception : " + e.getMessage());
          }
          return null;
      }
docs: Read body string.
  
  @param request the request
  @return the string