Reputation: 21
I have a discussion, how to implement content negotiation for error cases. I'd like to hear your opinion or experiences to deal with this topic. Please be aware that there might be APIs dealing with RFC-7807, and those who don't.
The main theses to discuss are (only concerning error responses):
application/problem+json
or application/problem+xml
, although the client requested application/pdf
.application/json
, and we return application/problem+json
, it's the same format, but not the same semantic and therefor has a different scheme in comparison with the 2xx response.application/problem+xml
, it only prefers a special content type in case of error responses, but does not specify one for 2xx responses, so the server would use its preferred (mostly JSON).What do you think about that?
Upvotes: 1
Views: 105