1

I have been reading up on Rest queries for SP2010, but at the moment I dont have an enviroment to test on.

would these two queries return items 10-19 of the Example list?

var test1= siteUrl + "_vti_bin/ListData.svc/Example $skip=10&$top=10"

var test2= siteUrl + "_vti_bin/ListData.svc/Example(19) $skip=10"

if they both return items 10-19, which is the most efficient?

any tips on the easiest way of testing sp2010 compatible queries is appreciated

EDIT:

I was able to run tests at odata.org

I used this query: http://services.odata.org/OData/OData.svc/Products?$skip=2&$top=3

and the result was products 2,3 and 4. it skipped products 0 and 1.

that means that _vti_bin/ListData.svc/Example?$skip=10&$top=10 would return items 10-19

1 Answer 1

2
  • When you request for a specific item (Example(19)) you can't use $skip or $top.
  • The $skip and $top parameters must be passed in as querystrings.
  • Remember to start at root path (/), so siteUrl must end with /.

.

var siteUrl = "/somesite/";
var test1 = siteUrl + "_vti_bin/ListData.svc/Example?$skip=10&$top=10"
var test2 = siteUrl + "_vti_bin/ListData.svc/Example(19)"
2
  • ok, that clears up all doubts on the second query. just one more thing i want to clear up, would $skip=10&$top=10 bring back results 10-19 or 11-20? Apr 21, 2014 at 17:58
  • I found the answer to the question in my last comment. I will edit my question with my findings. Apr 21, 2014 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.