O'Reilly logo

Lift Application Development Cookbook by Gilberto T. Garcia Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting data from the server

In this recipe, we will learn how to build URLs to respond to GET requests. In other words, we will learn how to serve data to the clients of your API. This means that you will be able to create a REST URL, where you can fetch a collection from data of a given resource—data about clients in this case—or fetch data about a specific resource.

Getting ready

You can either use example codes, which we have used in the recipes from previous chapters, or you can start a new project.

After creating the project, we will need to create a list of clients to serve as an in-memory database. We will need a model class to keep the data that will be shown on the page:

  1. Inside the code.model package, let's create a class named Client with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required