incubator-esme-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ethan Jewett <esjew...@gmail.com>
Subject Re: Excellent REST API Suggestion from Ethan Jewett
Date Mon, 16 Feb 2009 01:42:14 GMT
David,

Part of the reason that I was reading the AtomPub protocol today was for
help on this type of question.  As I said in response to Dick's tweet, I
think the protocol might be able to help do some of our thinking for us.

In this case, AtomPub (
http://bitworking.org/projects/atom/draft-ietf-atompub-protocol-17.html#rfc.section.5.5)
defines some 200-range response codes, but otherwise just specifies that
HTTP response codes should be used in conformance with the HTTP protocol.

So what does that mean?  It looks to me like we get:

Syntax problem with a resource that exists and is accessible - 400 Bad
Request (usually only for PUT/POST requests, since you can't really have a
syntax problem with a GET or DELETE)

Authorization issue - 401 Unauthorized

Resource not accessible to any user via API - 403 Forbidden (for resources
that should only be accessible through the human interface - password reset,
for example)

Resource doesn't exist - 404 Not Found

I'm not sure if it ever really makes sense to return a 500-range error for a
request that doesn't actually cause an internal error.

I haven't really looked carefully at the way other REST APIs implement HTTP
response codes, so I'm not saying that this is the way to go, but it might
be a starting point for conversation.

Ethan

On Sun, Feb 15, 2009 at 6:33 PM, David Pollak <feeder.of.the.bears@gmail.com
> wrote:

> Ethan,
> This is very good stuff.  I've been working through Sam Ruby's REST book,
> but you've boiled everything down for me... except... what kind of non-200
> error codes should happen when stuff is not specified correctly?
>
> Thanks,
>
> David
>
>
>
> On Sun, Feb 15, 2009 at 6:23 AM, Ethan Jewett <esjewett@gmail.com> wrote:
>
> > Thanks for the kind words Dick.  I'd definitely be interested in
> discussing
> > the suggestion and working on extending it into something more useful to
> > the
> > project.
> >
> > Thanks,
> > Ethan
> >
> > On Sun, Feb 15, 2009 at 4:20 AM, Hirsch, Richard <
> > richard.hirsch@siemens.com
> > > wrote:
> >
> > > Ethan has written a blog with a suggestion for a REST API for ESME (
> > > http://www.esjewett.com/blog/a-restful-esme-api). Ethan's ideas are
> > quite
> > > good and I think would improve our API. The more REST-ful API would
> also
> > > make our API more similar to that of other microblogging platforms.
> > >
> > > Take a look - I think it is an excellent start
> > >
> > > D.
> > >
> > >
> > >
> >
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message