users@jersey.java.net

Re: [Jersey] Describing a modified resource in REST

From: Luke Monahan <luke.monahan_at_remora.com.au>
Date: Sat, 21 Jun 2008 10:15:49 +1000

On Saturday 21 June 2008 07:07:21 Chris Wilkes wrote:
> So the steps would be
> POST /resources/companies/IBM/scenarios
> scenario1
> scenario6
> scenario61239
> They get back
> { id: adslj148714dasjla08252 }
>
> Then use
> GET /resources/companies/IBM/scenarios/adslj148714dasjla08252

We're using a similar method to do complex searches using Jersey:

POST /resources/search
        name=john
        city=Melboune
        etc. etc.

returns

201 (Created) with location /resources/search/1234

And the client then:

GET /resources/search/1234/results

Having the results as a separate sub-resource allows retrieving of the search
parameters again (i.e. for populating a search form with the previous
search).

We store the search parameter resource in the session rather than at the
database, for what it's worth.

Luke.