Paging in the REST-api

Heiko W.Rupp hrupp at redhat.com
Wed Feb 20 09:39:35 UTC 2013


To follow up

Am 20.02.2013 um 09:11 schrieb Heiko W.Rupp:
> 
> And for parsing I guess in almost all languages other than java, this can be expressed in two lines :)
> But then parsing { 'paging' : [ { "url":"http://foo...","rel":"next"},{....}]} is not obvious either.
> 

JAX-RS 2 has a Link object that has a valueOf() method that does this parsing.
Javascript has a number of implementations

> Pragmatically, the way our REST APIs will be used is primary via CL/I(javascript) so not having to reach 
> into the header and parse pagnation data will make much simpler/powerful integration scripts for our customers (IMO).

HATEOAS and REST is also about representation of state in different media types. You mention XML and Json,
but there are others - users could also be represented as .jpg images of their avatars. Or as a .vcard. The rest-api could return
metrics as a rendered .png or as .svg to be rendered by the client.
Or one could return CSV data. 
Now in CSV how would you add the paging information inside the CSV data? Add them as comment section?
Here putting the paging in the header does not alter the body content. And it is the same no matter
what content type you have.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.fedorahosted.org/pipermail/rhq-devel/attachments/20130220/e6c6e953/attachment.sig>


More information about the rhq-devel mailing list