Get RequestBody and ResponseBody at HandlerInterceptor

前端 未结 7 1752
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-14 11:31

Logic I have to implement is logging all requests with body served to DB.

So I decided to use: afterCompletion method of HandlerInterceptor

7条回答
  •  無奈伤痛
    2020-12-14 12:28

    As far as I know, RequestBody and ResponseBody can be read only once. So you should not read them in an Interceptor. Here's some explanation.

提交回复
热议问题