(发送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


版权声明:本文为shujuku____原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。