-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How should paging be used in rest APIs #111
Comments
Hello, do you have any suggestions on this? |
@avelanarius - can you see if we have an idea for the above? |
Seems like it's a similar issues as this one but I've encoded the token and when trying to decode it I get the above mentioned error |
And note that because this is sent in a GET request as parameter, the path will look something like: So I'm curious how can we pass the PageState from one request to another because even if you base64 encode it, it still doesn't work |
I made it work by using hex encode/decode .e.g |
The |
While there are some examples here and here on how paging should work in theory, these examples do not clearly show on how you would use the paging state in a Json rest API.
So the theory is that you execute a select statement, save the current paging state, return it to the user in string format and then use it the next time the user requests the next page.
I've tried using the examples you've posted such as:
I have a struct that contains the paging state parameter
And when a request is sent I bind it to a struct variable
I then execute the query as
And then the nextPageState I encode it to string and return it to the client
So while the first time I request this it works and the first three elements are returned in the API, when using the received page state value and send it in a new request I get
"error": "illegal base64 data at input byte 165"
. That's because the encoded string contains a '\' character.So the question is how to properly send and receive the paging state in these requests?
The text was updated successfully, but these errors were encountered: