Is there a way to get raw http request stream from Java servlet handler?

后端 未结 3 892
南笙
南笙 2020-12-18 11:27

I am trying to put some logging to capture the raw http request coming to my application. My Java code is inside a SpringMVC controller. I have access to the \"HttpServletRe

3条回答
  •  春和景丽
    2020-12-18 12:29

    I managed to read my raw request in my webapplication deployed on Tomcat 5.5

    All I had to do is to read HttpServletRequest through my servlet/Spring controller using request.getInputStream() only.
    It must be the first API approach to the request. before any filter or other command start to mass with the request that cause its completely reading by the webserver.

    What's the problem with that approach?

提交回复
热议问题