HTTP 501 for java.lang.UnsupportedOperationException

I have a common REST service level written in Java modules that can be connected. If any of the desired operation is not supported by the module (GET / POST / PUT / DELETE of the resource), the module issues java. lang.UnsupportedOperationException or the equivalent type of exception that I have.

So, can I return the HTTP 501 error code to the client in this case?

+5
source share
1 answer

In this case, you should use the 405method is not allowed (all quotes from Wikipedia ):

, ; , GET , POST PUT , .

501 :

, .

, .

+6

All Articles