0

I have a set of REST services that all follow same URL/verb pattern.
A few of those do not implement certain inessential combinations of URL/verb.

Since the application using those services does not know in advance which operations are implemented, it has to discover unimplemented ones dynamically.

I see two approaches:

  1. Sending 501 Not Implemented when the operation is requested
  2. Setting up OPTIONS support so that services can declare what they support

First approach seems better at the moment, since it is easier to implement, and requires one less request for the positive case (considering that OPTIONS are not cacheable).

Is there anything technically wrong with that approach?

Andrey Shchekin
  • 21,101
  • 19
  • 94
  • 162
  • A 501 should be returned when the server doesn't implement a method/verb at all. A 405 "Method Not Allowed" should be returned if an individual URL doesn't support a method/verb that is otherwise supported on other URLs. The accepted answer remains correct, though :-) – amichair Jul 09 '15 at 15:51

1 Answers1

2

They don't exclude each other. You should implement both.

Pedro Werneck
  • 40,902
  • 7
  • 64
  • 85