request.mutate
时间: 2023-10-18 18:00:14 浏览: 162
request.mutate是指对请求对象进行修改或者添加属性。请求对象是一个封装了当前请求的所有请求信息的对象,可以通过request对象获取请求头数据、请求行数据和用户数据等信息。使用request.mutate方法可以修改请求对象的属性,比如添加或修改请求头信息。在上述引用中,通过request.mutate().header("test1","test2").header("test2","test2")的方式,我们可以给请求对象添加名为"test1"和"test2"的请求头信息,并将其值分别设置为"test1"和"test2"。最后,通过返回修改后的请求对象,可以将修改后的请求对象传递给处理请求的方法或过滤器。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [springcloudGateway重写请求后,serverHttpRequest.mutate().header失效](https://blog.csdn.net/qq_45036538/article/details/121741200)[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_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Servlet 学习笔记](https://blog.csdn.net/Miss_HuangT/article/details/105041538)[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_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文