How to get the result of a GET request "splitted" with REST API
Hello,
I created a java application to make GET requests with REST API. It works for small results, but if the XML page returned is too big, the connection is lost and i get only a small part of the data I need. The url I'm using is something like this: https://address:9443/jazz/oslc/queries/_hFblYPIREeO27NaQrcNhvA/rtc_cm:resultsI thought that if i were able to get the data I need in distinct pages, i could get them all without problems. So I made some research and discovered that it is actually possible to split the page, but I none of the solution given worked for me. So my question is: how can I get the data splitted in different pages, so i can navigate them and get all the datas? |
2 answers
Dinesh Kumar B (4.1k●4●13)
| answered Jun 23 '14, 4:23 a.m.
JAZZ DEVELOPER edited Jun 23 '14, 4:24 a.m.
have you tried the Resource Paging as mentioned in :
Resource Paging section of http://open-services.net/bin/view/Main/OslcCoreSpecification?sortcol=table;up=#Query_Capabilities here is an extract from the above link :
Another solution is to use Resource Paging; here's how it works. To get a paged version of a resource, a client adds the "key=value" pair
When a page is returned and it is NOT the last page in the sequence, then it SHOULD include an
oslc.pageSize
to the query string component of the resource URI. By adding this, a client requests that the server respond with a specific number of property values. For example,
oslc.pageSize=20
indicates to the server that the client would like 20 values per page. OSLC Services MAY ignore
oslc.pageSize
hope it helps. |
I tried that too, but is seems to do not work. I don't know exactly how to make queries or set parameters in this URL.
I tried some URLs but the server just ignores them and tries to give me the whole page. I'm currently testing it on my browser, but my java app does not work. I tried these: https://address:9443/jazz/oslc/queries/_hFblYPIREeO27NaQrcNhvA/rtc_cm:results?oslc.paging=true&oslc.pageSize=5&_startIndex=0
https://address:9443/jazz/oslc/queries/_hFblYPIREeO27NaQrcNhvA/rtc_cm:results?
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.