How can you restrict access to specific HTTP methods in Spring Security?

  • By using @RequestMapping annotations
  • By defining custom HTTP headers
  • By using Java annotations like @Secured or @PreAuthorize
  • By configuring the httpMethod attribute in security rules
In Spring Security, you can restrict access to specific HTTP methods by configuring the httpMethod attribute within security rules. This allows you to specify which HTTP methods are allowed or denied for a particular URL pattern. The other options are not used to restrict access to HTTP methods in Spring Security, but rather for other purposes, such as defining mappings or custom headers.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *