3 ms·
You could definitely use content negotiation to present human-friendly errors if you were exposing HTML out of the API itself. But otherwise the concept of "hu
by awinder 12y ago
You could definitely use content negotiation to present human-friendly errors if you were exposing HTML out of the API itself. But otherwise the concept of "human friendly" APIs seems a little weird to me. Likewise, the idea that error codes are more friendly than links to error entities also seems way more developer- / human-friendly. Random per-application error codes seem like a really bad idea to me, if you have the need to expose more information about a group of errors, the right way seems like this approach - link to a common error object, which itself contains classification details
- xg15 12y agoYou are right that this is no good idea in the general case. But I think there are a few endpoints that have "pretty printing" outputs for developers enabled if text/html is in the accept list. At least the (internal) deviantart API did have that some time ago. I agree that the whole thing can be solved nicely with content negotiation.