从HttpServletRequest中获取body中的参数

Map<String,Object> params = new HashMap<String, Object>();
        BufferedReader br;
        try {
            br = request.getReader();
            String str, wholeStr = "";
            while((str = br.readLine()) != null){
                wholeStr += str;
            }
            if(StringUtils.isNotEmpty(wholeStr)){
                params = JSON.parseObject(wholeStr,Map.class);
            }
        } catch (IOException e1) {
            logger.error(""+e1);
        }
原文地址:https://www.cnblogs.com/mm962464/p/13372611.html