3 ms·
See 3.2: "extension members". A reason phrase from the HTTP response can't contain structures which are easily parsed, this proposal does make this possible. W
by juriansluiman 12y ago
See 3.2: "extension members". A reason phrase from the HTTP response can't contain structures which are easily parsed, this proposal does make this possible.
We are using this format for quite some time and it is very easy to use. In above example "Not Enough Credit" sounds reasonable, but you often want to inform users with more information: what was the transactional amount, what is the balance, are there other reasons the transaction failed? You can easily extend the response with more fields to indicate such thing.
Besides, you can track any error in your backoffice system and link the error number in your response. This allows you to have direct insights in error history for customer support ("Hey I got an error and the system said to report number 23473 to you, can you help me?").