REST API 202 vs 204

I deal with the REST API and ask this question, when the request is planned for further processing, we must return 202, when the request does not have a response body, we must return 204. What should we do when the request is in further processing, but does not have a body an answer?

Thanks in advance!

+2
rest api return-value
Jan 02 '13 at 14:48
source share
3 answers

This will be 202. After processing (and successful), the response body is missing.

If there is no possibility of failure, or the client does not care about the failure, and the client does not care when the action is completed, then it would be convenient, since there is no point in postponing it.

+4
Jan 02 '13 at 14:50
source share
+1
Jan 04 '15 at 15:16
source share

Why don't you return the response body for 202? According to specification:

The object returned with this response MUST include an indication of the current status of the request and a pointer to a status monitor or some indication of when the user can wait for the request to complete.

You may not have a detailed answer, but that will not change the correct response status code.

0
Jan 02 '13 at 15:53
source share



All Articles