Re: http: Diagnostic instead of reason codes Q

On Wed, Sep 06, 2023 at 05:41:48PM +0200, Toerless Eckert wrote:
> If i build a REST API via HTTP, and there is a semantic issue with
> some operation, GET/POST. I guess it is NOT appropriate to indicate
> the specific semantic issue in the reason code of the HTTP status
> line. Especially i guess it is not appropriate to attempt
> distinguishing two different semantic error conditions by returning
> the same http status code, but two different reason codes.

One really nasty one is "route not found" versus "item not found". Both
are canonically 404, but the meaning is very different, and it is a
serious flaw to confuse the two.

Even if using problem documents, there is a catch: Any 404 without a
valid problem document must be treated as route not found, because
various components (reverse proxies, intermediates, routers) are
likely to generate some strange responses if hitting route not found.




-Ilari

Received on Wednesday, 6 September 2023 17:01:15 UTC