HTTP Status 405 - Request method 'PUT' not supported

Try turning up the logging level for org.springframework.web to DEBUG. This will give you some insight into how Spring is trying to deal with the request. Hopefully, it will give you (or us) some more clues on how to fix it.

If you're using Spring Boot, just add this line to your application.properties file:

logging.level.org.springframework.web=DEBUG

Edit after seeing additional logging:

The 'PUT' not supported message is a bit misleading. The real problem comes before that. You don't have a valid CSRF token. How are you submitting the request? It looks like you are using the PostMan tool (but I am not familiar with this tool) rather than submitting the form directly from a web-page. There may be some way that you can add the token to your request using the tool. Does it work without the tool - submitting the form directly from the web-page?


I had the same error but for me it was caused by the fact that I had ommited the ID as URL parameter. I ommited it because the ID was present in the JSON body.

When I changed .../restaurant to ...restaurant/1, the error went away.