If at all any error message should be returned with status code 405, what should it say? I suspect we should not return any, but just to make sure are there any best practices for this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Given that
405meansMethod not allowed, it’s pretty obvious to anyone familiar with HTTP or other RESTful APIs what it means.However, not all of your customers writing software with your APIs might have that prior experience, so it might be worth returning a message in the response that says something like, “This resource does not support the HTTP method PUT.”
You might also want to include a hint in the returned message to tell the user to call
OPTIONSto find out which methods are supported, assuming you implement it as such.