From: "Heiko W.Rupp" <hrupp(a)redhat.com>
To: rhq-devel(a)lists.fedorahosted.org
Sent: Wednesday, February 20, 2013 10:39:35 AM
Subject: Re: Paging in the REST-api
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.
_______________________________________________
rhq-devel mailing list
rhq-devel(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/rhq-devel