Spring Rest-API - 403 forbidden error response

前端 未结 1 931
我在风中等你
我在风中等你 2021-01-15 10:01

I,m new to spring, I,m writing REST API. I/\'m getting 403 forbidden error for delete, put. Following is the sample I\'m working on.

@RequestMapping(value =          


        
1条回答
  •  既然无缘
    2021-01-15 10:20

    Just add these filter line in web.xml.

    
            CorsFilter
            org.apache.catalina.filters.CorsFilter
            
                cors.allowed.origins
                *
            
            
                cors.allowed.headers
                Content-Type,X-Requested-With,accept,authorization,Origin,Access-Control-Request-Method,Access-Control-Request-Headers
            
            
            cors.allowed.methods
            GET, POST, PUT, DELETE, OPTIONS, HEAD
        
        
    

    0 讨论(0)
提交回复
热议问题