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

后端 未结 3 894
南笙
南笙 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:21

    No, servlets provide no api to get at the raw request - you might need a sniffer like wireshark for that.

    You can get at the parsed request headers and uri though:

    • getHeaderNames()
    • getRequestURI()

    etc.

提交回复
热议问题