I
I
IDDH2017-04-18 22:18:11
API
IDDH, 2017-04-18 22:18:11

Correct API GET response when resource is missing: null or 404 not found?

For example, there is a GET request to the /books/123 API. There is no book with ID 123.
What is the more correct api answer? Null or, after all, the message not found and the status 404?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2017-04-18
@IDDH

If you adhere to the REST API concept, then stackoverflow.com/questions/11746894/what-is-the-p...
Otherwise, it depends on who will receive this data and how to process it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question