1

I use Azure with DocumentDB as my database. I use the continue (paging) option for enable paging in search . I received the following token from my database , and I want to pass that token to my client via WebAPI http. the token is : "{\"token\":\"+RID:blablablabla==#RT:1#TRC:20#RTD:bOCA\",\"range\":{\"min\":\"\",\"max\":\"FF\"}}

My problem is that when I send the token from my user I receive part of the token, so what I need to send to my remote client? Thanks!!! MAK

I solve the problem by sending the token in POST method instead in GET method add the token in the request body !

MAK
  • 605
  • 9
  • 19
  • when you get it back from your client, you only get a partial token? how are you passing it from client to server? – woelliJ Jun 18 '17 at 19:27
  • Can you show us more detailed coding response that you generate from WebAPI? – omerv2 Jun 18 '17 at 19:33
  • I received the following error in my android application java.lang.IllegalStateException: not valid as a java.net.URI my token is: {"token":"+RID:blablablablablaAAAAAAAAAA==#RT:1#TRC:20#RTD:bOCA","range":{"min":"","max":"FF"}} – MAK Jun 18 '17 at 20:04
  • @woelliJ I received exception in my android application .In addition when I try to send the token via postman application , postman cut part of the token – MAK Jun 18 '17 at 20:09
  • how are you parsing the token? Sorry but you're just offering to little information. Please post all relevant code if possible – woelliJ Jun 19 '17 at 07:15

1 Answers1

1

It seems that you’d like to implement paging through query results via the continuation token (x-ms-continuation). I do a test on my side to retrieve the next page of results from a query executed earlier, which works fine, please refer to it to construct the request.

enter image description here

Resubmitting the request with the x-ms-continuation request header (cannot be used with a different query)

enter image description here

Fei Han
  • 26,415
  • 1
  • 30
  • 41
  • Hello , thanks for your comment. But I am not woking directly with the documentDB service . I pass via WebAPI2 service , that received the message and after some processing retrieve the information from the documentDB – MAK Jun 19 '17 at 09:19
  • Does your WebAPI return both query result and continuation token to the caller/client? the caller could maintain the continuation token in local storage and resubmit the request with the x-ms-continuation request header to do same query to get the next page result. – Fei Han Jun 20 '17 at 09:42