403 forbidden when I try to post to my spring api?

后端 未结 4 688
青春惊慌失措
青春惊慌失措 2021-02-05 22:59

Using postman, I can get a list of users with a get request to: http://localhost:8080/users.

But when I send a post request to the same address, I get a 40

4条回答
  •  失恋的感觉
    2021-02-05 23:41

    Please configure your http like this ;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
            //configureothers if u wants.
            .csrf().disable();
    }
    

    Please read for more CSRF

提交回复
热议问题