79279605

Date: 2024-12-13 21:23:35
Score: 5
Natty:
Report link

For anybody having the same problem but csrf is disabled:

  1. Check that you permitted the controller url in your SecurityFilterChain if you are using Spring Security, although this should create an access denied exception.
  2. Make sure to select the correct mapping for the controller method. @GetMapping for a get request and @PostMapping for a post request.

If you send a post request to a method declared with @GetMapping spring boot will throw the 405 error.

Reasons:
  • No code block (0.5):
  • Me too answer (2.5): having the same problem
  • User mentioned (1): @GetMapping
  • User mentioned (0): @PostMapping
  • User mentioned (0): @GetMapping
  • Low reputation (1):
Posted by: FullMetalJack