欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

(发送post请求报错)There was an unexpected error (type=Forbidden, status=403). Forbidden

程序员文章站 2022-07-12 11:30:11
...

(发送post请求报错)There was an unexpected error (type=Forbidden, status=403). Forbidden

SpringSecurity发送post请求报错

解决方法:关闭跨站攻击功能(http.csrf().disable())

public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        ...
        http.csrf().disable()
        ...
    }
}

更多细节前往https://blog.csdn.net/doStruggle/article/details/80589126

相关标签: 狂神SpringSecurity