Bird
0
0

What HTTP status code is typically returned by the default handleHttpRequestMethodNotSupported method in ResponseEntityExceptionHandler?

medium📝 component behavior Q5 of 15
Spring Boot - Exception Handling
What HTTP status code is typically returned by the default handleHttpRequestMethodNotSupported method in ResponseEntityExceptionHandler?
A400 Bad Request
B405 Method Not Allowed
C404 Not Found
D500 Internal Server Error
Step-by-Step Solution
Solution:
  1. Step 1: Recall default behavior of handleHttpRequestMethodNotSupported

    This method returns HTTP 405 to indicate the HTTP method is not supported for the requested resource.
  2. Step 2: Verify other status codes

    400 is for bad requests, 404 for missing resources, 500 for server errors, none fit this scenario.
  3. Final Answer:

    405 Method Not Allowed -> Option B
  4. Quick Check:

    Method not supported status = 405 [OK]
Quick Trick: 405 status means HTTP method not allowed [OK]
Common Mistakes:
  • Confusing 405 with 404 or 400
  • Assuming 500 for all errors
  • Ignoring HTTP method context

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes