=== get 1 row
Request:
GET /artist?rows=1
Accept: application/hal+json
Response:
200 OK
Content-type: application/hal+json
{
"_embedded" : {
"artist" : [
{
"_links" : {
"cds" : {
"href" : "/cd?me.artist=1"
},
"cds_cref_cond" : {
"href" : "/cd/1"
},
"self" : {
"href" : "/artist/1"
}
},
"artistid" : 1,
"charfield" : null,
"name" : "Caterwauler McCrae",
"rank" : 13
}
]
},
"_links" : {
"next" : {
"href" : "/artist?rows=1&page=2"
},
"self" : {
"href" : "/artist?rows=1&page=1",
"title" : "TestSchema::Result::Artist"
}
}
}
=== get 2 rows with count
Request:
GET /artist?rows=2&with=count
Accept: application/hal+json
Response:
200 OK
Content-type: application/hal+json
{
"_embedded" : {
"artist" : [
{
"_links" : {
"cds" : {
"href" : "/cd?me.artist=1"
},
"cds_cref_cond" : {
"href" : "/cd/1"
},
"self" : {
"href" : "/artist/1"
}
},
"artistid" : 1,
"charfield" : null,
"name" : "Caterwauler McCrae",
"rank" : 13
},
{
"_links" : {
"cds" : {
"href" : "/cd?me.artist=2"
},
"cds_cref_cond" : {
"href" : "/cd/2"
},
"self" : {
"href" : "/artist/2"
}
},
"artistid" : 2,
"charfield" : null,
"name" : "Random Boy Band",
"rank" : 13
}
]
},
"_links" : {
"last" : {
"href" : "/artist?rows=2&with=count&page=3"
},
"next" : {
"href" : "/artist?rows=2&with=count&page=2"
},
"self" : {
"href" : "/artist?rows=2&with=count&page=1",
"title" : "TestSchema::Result::Artist"
}
},
"_meta" : {
"count" : 6
}
}
=== get 2 rows from second 'page'
Request:
GET /artist?rows=2&page=2
Accept: application/hal+json
Response:
200 OK
Content-type: application/hal+json
{
"_embedded" : {
"artist" : [
{
"_links" : {
"cds" : {
"href" : "/cd?me.artist=3"
},
"cds_cref_cond" : {
"href" : "/cd/3"
},
"self" : {
"href" : "/artist/3"
}
},
"artistid" : 3,
"charfield" : null,
"name" : "We Are Goth",
"rank" : 13
},
{
"_links" : {
"cds" : {
"href" : "/cd?me.artist=4"
},
"cds_cref_cond" : {
"href" : "/cd/4"
},
"self" : {
"href" : "/artist/4"
}
},
"artistid" : 4,
"charfield" : null,
"name" : "KielbaSka",
"rank" : 13
}
]
},
"_links" : {
"first" : {
"href" : "/artist?rows=2&page=1"
},
"next" : {
"href" : "/artist?rows=2&page=3"
},
"prev" : {
"href" : "/artist?rows=2&page=1"
},
"self" : {
"href" : "/artist?rows=2&page=2",
"title" : "TestSchema::Result::Artist"
}
}
}