Spring boot 如何在springboot中的prehandler中获取请求体{object}?

Spring boot 如何在springboot中的prehandler中获取请求体{object}?,spring-boot,logging,spring-security,handler,Spring Boot,Logging,Spring Security,Handler,如何在springboot中的prehandler中获取请求体{object} 我尝试使用以下方法: 。字节[]bb=request.getInputStream().getBytes(); log.info(新字符串(bb)) 但它正在提供丢失的请求主体 String response=IOutil.toString(request.getINputStream()) 正在获取丢失的请求正文 我想处理hpp(我的spring应用程序中的http参数污染) 请帮助我解决问题在1种情况下,您可能应

如何在springboot中的prehandler中获取请求体{object}

我尝试使用以下方法:

  • 。字节[]bb=request.getInputStream().getBytes();
    log.info(新字符串(bb))
  • 但它正在提供丢失的请求主体

  • String response=IOutil.toString(request.getINputStream())
  • 正在获取丢失的请求正文

    我想处理hpp(我的spring应用程序中的http参数污染)


    请帮助我解决问题

    在1种情况下,您可能应该使用BufferedReader。

    就您试图解决的问题(防止hpp)而不是您建议的解决方案提出问题。