A
A
Alexey Kalenchukov2021-04-14 22:40:07
API
Alexey Kalenchukov, 2021-04-14 22:40:07

What to return if the object does not exist?

There is an API:
/users/{id}
/groups/{id}/add?categiry={categiry_id}

What result should be returned if the given {id} does not exist?
What result should be returned if the given group category {categiry_id} does not exist?
What result should be returned if the given {id} or the given group category {categiry_id} does not exist?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kudrya, 2021-04-14
@kalenchukov

statuses - select the appropriate status and return it in the response with a message, you can make a list of constants and some kind of dock with their description, or you can simply textually tell what the problem is
. If there is no suitable status, then no one bothers to add your own (for example, in laravel 419 is actively used because it is not reserved)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question