[Opensim-dev] Asset Server Rest Interface

Sean Dague sean at dague.net
Mon Nov 5 13:05:01 UTC 2007


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.

> 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


> DELETE:
> <DeleteResponse>
> <Result success="true">Ok</Result>
> </DeleteResponse>
> Content-type: application/xml

Don't return content, just return

200 - success
401 - forbidden
404 - not found

> POST:
> <CreateResponse>
> <Result success="true">Ok</Result>
> <AssetId>xxx</AssetId>
> </CreateResponse>
> Content-type: application/xml

Return the full object after post (if successful)

201 - created
401 - forbidden

GET and POST responds with an object, but "what happened" is put into
the status codes.  I'm sure there are a few more in the 500s that would
make sense to put into place as well.

     -Sean

-- 
__________________________________________________________________

Sean Dague                                       Mid-Hudson Valley
sean at dague dot net                            Linux Users Group
http://dague.net                                 http://mhvlug.org

There is no silver bullet.  Plus, werewolves make better neighbors
than zombies, and they tend to keep the vampire population down.
__________________________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20071105/a9f6872a/attachment-0001.pgp>


More information about the Opensim-dev mailing list