Answer the question
In order to leave comments, you need to log in
What is the best way to return successful requests and errors in REST API?
How are the latest fashion trends about what response format should be in a REST API? I know there is no standard. For example, is it worth returning "code: 422 / http code 200", or is it better to return it only as http 422 and return arrays of errors in json? And in general, in general, how is it generally better to return successful requests and errors? How are you doing?
Answer the question
In order to leave comments, you need to log in
How is this not a standard? There is. If successful, return code 200 in the header and in the data body in the format that the client expects. In case of an error, the error code and text of the error message.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question