
SpringSecurity发送post请求报错
解决方法:关闭跨站攻击功能(http.csrf().disable())
public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
...
http.csrf().disable()
...
}
}
本文介绍了解决SpringSecurity中POST请求错误的方法,通过在配置类中禁用跨站请求伪造(CSRF)保护,可以避免POST请求时出现的CSRF令牌缺失错误。
31万+

被折叠的 条评论
为什么被折叠?



