(发送post请求报错)There was an unexpected error (type=Forbidden, status=403). Forbidden
程序员文章站
2022-07-12 11:30:11
...
SpringSecurity发送post请求报错
解决方法:关闭跨站攻击功能(http.csrf().disable())
public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
...
http.csrf().disable()
...
}
}