springboot,怎么在get和post的url中加入特定的参数,谢谢

springboot,怎么在get和post的url中加入特定的参数,谢谢

问题描述:

springboot,通过springboot特有的方式,怎么在get和post的url中加入特定的参数,最好是写个例子。比如写到拦截器里或者什么地方,监测到服务器向外get或者post时,加特定的参数。

是 url?name="sss"&age=12 这样吗 没看懂你的需求

监测到服务器向外get或者post时,加特定的参数?
是你访问别人,还是别人访问你?
别人访问你,拦截器,过滤器都行
你访问别人,调用同一个工具类

监测到服务器向外get或者post时,加特定的参数

@RequestMapping(value = "/say/{id}", method = RequestMethod.GET)
public String say(@PathVariable("id")Integer id){
return "hello" + id;
}

都不是我想要的答案。

可以在拦截中对 请求 添加 header 属性 ,将需要的特定参数添加到header 中。