[Opensim-dev] Asset Server Rest Interface
Tleiades Hax
tleiades at gmail.com
Mon Nov 5 13:39:22 UTC 2007
On 11/5/07, Sean Dague <sean at dague.net> wrote:
>
> On Mon, Nov 05, 2007 at 10:11:39AM +0100, Stefan Andersson wrote:
> > Uh, not entirely sure how to read the current state of the draft, but
> just wanted to make sure that
> > POST /assets/new should returd assetid in response, as we can't rely
> > on everybody 'playing nice'.
>
> My initial thought was that it returns the full object, with UUID in
> place.
I think it is a bad idea to let the asset server assign the asset id, this
will make it necessary for the client to wait for the asset id to be
returned, leading to a lot of situations where the client will hold an
"internal" id, and then later fix up the internal representation with the
actual and real asset id.
One of the beauties, almost the only one I can think of actually, by using
UUID's as a data type for id's is that they can be created and assigned
client side, without fear of collision and/or elaborate schemes for ensuring
uniqueness.
By implementing a protocol where the assets server is responsible we force
the hand of the client designers and architects to either create assets in a
synchronous process or force them into a situation where assets have two
id's, an "internal id" and a public "external id". I would strongly
recommend that we leave it up to the client to assign the asset id.
> The Draft should also define the response on all commands; I'd suggest
> > we use an xml posted object response; something like
>
> Why don't we just use HTTP response codes instead (full list at:
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)
>
> > GET:
> > The binary asset,
> > Content-type: xxx
>
> Besides content also setup the response codes correctly
>
> 200 - success
> 401 - forbidden
> 404 - not found
I agree with using response codes, anything else will be too "XML-RPC"'ish,
and not really rest. Unfortunately this will require some rewriting of the
basic HTTP server implementation code we use, which will impact a lot of
code. I am not saying that we shouldn't do that, but lets do one thing at a
time.
> DELETE:
> > <DeleteResponse>
> > <Result success="true">Ok</Result>
> > </DeleteResponse>
> > Content-type: application/xml
we need to decide what our content type is going to be, MW clearly likes
"text/xml", this says "application/xml", I have tried to discover, what the
correct content-type is, but have found nothing conclusive the "XML Media
Types <http://www.ietf.org/rfc/rfc3023.txt>" RFC seems to leave it up to us,
but I do propose that we are consistent.
I think it is too early days to commit to a "formal" spec, I am convinced
that the current layout will change quite a number of times, from now and
til version 0.6.
/tleiades
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20071105/02dd96a3/attachment-0001.html>
More information about the Opensim-dev
mailing list