Can anyone tell me if there is a way in which calling an API sequentially would make the result list grow sequentially rather than retrieving all data at once? Such as the first call would return an empty list, the second one item, and so on until all data is ingested completely. The app would be a simple asp net API that is connected to a Postgres database that ingests the data. Thank you!
Asked
Active
Viewed 304 times
0
-
API call is an interaction from client to the server and when you make these calls, they have nothing to do with each other. You can perhaps add an int to your request / query parameter that would indicate how many items you need in that list but each call would be separate without knowledge of previous or future calls. – Jawad Dec 15 '20 at 03:34
-
Third call return 2 item or 1 item? – MichaelMao Dec 15 '20 at 03:36
-
You can have the API to accept the pagenumber... so that API will return the paged data for that page number... let say pagenumber=5 and pagesize=10 then the API should return records from 41 to 50. – Chetan Dec 15 '20 at 03:44
-
Thanks guys for the answers! I think I didn't express myself the best way, I meant like, in order to demonstrate that an ingestion is taking place, that data is retrieved from a Postgres table, I would like to first when I run the application I want nothing to be retrieved because the ingestion process didn't start, and for a second time i would run the application items from the table to start appearing in the result, either just one, two, or all of them, but I need that the first time I run it to not retrieve anything, if that is possible. – davidJay Dec 15 '20 at 08:19
-
Sorry guys! I am relatively new to the field and I don't know these concepts really good – davidJay Dec 15 '20 at 08:20
-
right now the first time I run the application I instantly get all the data from the table, I don't know how to modify that. – davidJay Dec 15 '20 at 08:22
-
Based on your description, I suggest you could consider add a "Start" button in your main page, if you want to load data, you could click it and start to call the api and get the data, then display them. For calling data using the API, you could query data based on the page number, in the first time, you could get the first page data and the total page number(used to add page links dynamic). When display the data on the main page, you could display the page data based on the page number and the page links. After that, if you want to load more data, click the page links. – Zhi Lv Dec 16 '20 at 09:05