Introduction The previous three posts in this series have focused on paging over a relatively static data set, such as a customer list. When working with real-time data such as a Twitter feed, where new records are constantly being added, you can run into a situation where records are either duplicated between pages, or some records are completely skipped over. Rakhitha Nimesh has written an article about this entitled Paginating Real-Time Data with Cursor Based Pagination.
Introduction So far in the series we have looked in the first post at an introduction to paging in REST APIs and then looked at some specific implementations in ASP.NET Web API. In the second post I demonstrated how you could return pagination information in a simple JSON envelope, and in the third post I returned and requested all pagination information through HTTP headers. One constant so far in the previous two posts was that we would return details such as the page number, page size and number of pages in the pagination information.
Introduction In the previous post I did paging using both an offset based mechanism as well as a page based mechanism and returned the result inside a JSON envelope. In this blog post I will discard the envelope and return a simple JSON array of objects while returning the paging meta information in HTTP Headers. In the second part of the blog post I will also change the Web API method so that users of the API can request a specific page and specify the page size through a HTTP headers instead of query string parameters.
Introduction In the introductory post I looked at some of the various methods which some of the popular web applications use in their APIs to implement paging. In this post I will implement one of the more basic methods, namely how to return the list of records inside an envelope which contain paging information. The end user of the API will make a request such as the following: GET customers?
Introduction I am starting a new series of posts on performing paging in APIs using ASP.NET Web API. Before I get going I want to introduce you to the various techniques which some of the most popular APIs use. In subsequent posts we will then look at how to implement some of these techniques using ASP.NET Web API. So here are some of the varying implementations of pagination used:
In Part 4 of this series, I added sorting to the table. In this blog post I will add a search box which allows users to search for customers by first name or last name. Whenever a user types something into the search box we will automatically trigger a new request to the API to filter the customers based on the text the user entered. Add a search box The first step is very simple and that is to add a text box to the existing page.
In Part 3 of the series we finally added ngTable into the mix which allows us to display the data in a table and also page through the data. In this blog post we will look at adding sorting capabilities to our table. Setting ngTable up for sorting Allowing users to sort by a column in ngTable is as easy as adding a data-sortable attribute to each column for which we want to allow sorting.
In Part 2 I created an ASP.NET Web API with a single method that returns a list of customers. I then went on to show how to use Restangular to retrieve the list of customers and display them. In this blog post I will change the API method which retrieves the list of customers to allow for paging. Fix JSON formatting The first thing I want to do however is make a small change to the API.
Introduction I am currently involved in a project in which we use a combination of ASP.NET MVC and AngularJS powered by a ASP.NET Web API backend. For one of the pages we need to display tabular data in a grid where the user can filter, sort and page through the data. The Web API backend is a pretty standard REST based API and for communication between the API and the Angular frontend I have been using Restangular.