HandlerInterceptor拦截器如何重新设置请求体报文
时间: 2023-12-30 10:57:27 浏览: 85
HandlerInterceptor拦截器无法直接重新设置请求体报文。HandlerInterceptor接口主要用于在请求处理前后进行拦截和操作,可以在请求处理前对请求进行预处理,也可以在请求处理后对响应进行处理。但是,请求体报文是在请求发送时传递给服务器的,拦截器只能对请求进行拦截和处理,不能修改请求体报文。如果需要重新设置请求体报文,需要在发送请求的代码中进行处理。<span class="em">1</span><span class="em">2</span>
#### 引用[.reference_title]
- *1* [Spring拦截器HandlerInterceptor接口代码解析](https://download.csdn.net/download/weixin_38619967/12766301)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [基于springboot,通过拦截器实现请求和响应报文日志输出打印](https://blog.csdn.net/seamon0627/article/details/125155236)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文