3

We are implementing a REST interface, and we've decided to use application/atom+xml as the output format, as it gives us a nice standard way to return a list of items together with links to the related details.

However, we are struggling to find a standard way how to return errors. I know that setting a proper HTTP error code would be required, but what about the message? Atom 1.0 RFC does not mention error handling at all, Atom Publishing Protocol RFC says the response should contain a human-readable entity with error message. However, this does not help much. What MIME type should be ideally the response? Plain text? HTML?

Is it OK that if the client sends Accept: application/atom+xml, we return Content-Type: something else? Or would you rather recommend to embed the message into an Atom Entry? I'd like to stress out that the interface is meant for machines, not human users.

Thanks a lot for your suggestions.

2
  • Were you able to find the answer for this? I would like to know too. Apr 13, 2012 at 7:07
  • No, I did not find any other answer. We went with the solution of sending the single-entry feed, returning the MIME type the client asked for (together with a proper HTTP code).
    – Pavel
    May 11, 2012 at 15:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.