Error format for REST web services


I am just getting started with REST web services on Rails. I understand
that REST is an architectural style. However, I was wondering if there
is a commonly used format for sending back error messages.

For example, to a successful ‘create’ a REST service might respond with
the XML for the newly created model, but what would it send back if the
creation fails, maybe due to invalid data?


Screencast by topfunky just came out today on RESTful Rails: ($9 - great


On 10/8/06, Ingo W. [email protected] wrote:


Successful creations usually return a 201 Created response, along with
a Location header with the permalink of the new resource. Validation
errors return 400 Client Error, with an xml hash of the errors. This
is according to ActiveResource anyway. I think the Atom Pub API is
similar, yet it actually sends the new xml with a successful create,
along with the Location header.

Rick O.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs