5 ms·
When it comes to REST it's important to return correct response code. As to what comes in body is mostly convention and there are no standards. Here is an exam
by fleetfox 5y ago
When it comes to REST it's important to return correct response code. As to what comes in body is mostly convention and there are no standards.
Here is an example for rest:
https://github.com/Microsoft/api-guidelines/blob/master/Guidelines.md#7102-error-condition-responses https://github.com/Microsoft/api-guidelines/blob/master/Guid...
JSON-RPC is a bit more concrete:
https://www.jsonrpc.org/specification#error_object https://www.jsonrpc.org/specification#error_object
But again what you put into data is up to you.
Response structure might also depend on the client (content negotiation)