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

Creating data using the REST service

Now that we know how to fetch data, the next step is to learn how to create the data so that we can fetch it later.

Thus, we will learn how to create the REST URL, which will respond to the POST request.

Getting ready

We are going to modify the code we created in the previous recipe. You can duplicate the project from the last recipe to keep it separated or you can use the same one.

  1. Remove the following line from the boot method in the Boot class:
    ClientCache.startClient()
  2. Then modify the ClientCache object by adding a new import statement:
    import net.liftweb.http.SessionVar
  3. Remove the clients variable and the startClient method, and modify the object declaration from object ClientCache to object ClientCache extends ...

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