4 ms·
> People get so enamored with trying to make REST APIs into this rigorous thing. It is a rigorous thing, though. It's a standard, and one that has existed for
by MrPoush 4y ago
> People get so enamored with trying to make REST APIs into this rigorous thing.
It is a rigorous thing, though. It's a standard, and one that has existed for a very long time.
> I would prefer HTTP status codes just go away altogether. Those are for the web browser software to do things like navigation, not for APIs. Same with HTTP verbs.
Verbs and status codes are fundamental for APIs that consume REST endpoints.
I totally understand thinking that vanilla REST is not the perfect model for every case. Maybe you should be using SOAP, or GraphQL, or HATEOAS. What a seasoned engineer shouldn't be doing is abandoning a shared specification and expecting everyone else to comply.
If I am using a third party's API and they serve nonsensical status codes (4xx when their DB is down, 2xx to let me know something failed), I will reach out and ask for them to fix their bug. If they tell me that the error code is deliberate, I will probably look for a more sensible vendor to work with instead.