Error format for REST web services

Hi,

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?

thanks!
Ingo

Screencast by topfunky just came out today on RESTful Rails:
http://www.peepcode.com/articles/2006/10/08/restful-rails ($9 - great
value)

-Ryan

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

thanks!
Ingo

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.
http://weblog.techno-weenie.net
http://mephistoblog.com

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