1

I am using the Sitecore 7.2 Item Web API to retrieve some items. Using fast queries I am not able get a "404" in case an item doesn't exist (even if i don't use fast queries, i still don't get 404). All I get is a blank json response with "200" response. Any ideas why?

4

Fast query does not equal to web request. It should not return same codes.

You can execute fast query from Item Web API, from code, from XPath builder. And for these three places fast queries should work in a same way. I think that it would have no sense get 404 error when executing query code or XPath builder. 404 is response code for web Not Found. 404 response would mean that resource was not found, in other words: Item Web API endpoint that should execute your request was not found.

200 is response code OK. It means that your fast query was successfully executed and you can find result(s) in response(if any).

P.S.: To understand why this behavior is better, let's imagine that it would return 404 code as you wish. How would you define what happened:

  • No items were found during execution of query
  • Query was not executed. For some reason URL your_host/-/item/v1/?scope=c&query=your_query was not found.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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