O'Reilly logo

Lumen Programming Guide: Writing PHP Microservices, REST and Web Service APIs by Paul Redmond

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

© Paul Redmond 2016

Paul Redmond, Lumen Programming Guide, 10.1007/978-1-4842-2187-7_5

5. Creating, Reading, Updating, and Deleting Books

Paul Redmond

(1)Phoenix, Arizona, USA

Now that you have a Books model, you are well-equipped to handle the management of books. You will continue to follow your test-driven development workflow as you complete the remaining CRUD operations of the /books API.

Listing 5-1 shows a quick refresher of your /books RESTful endpoints.

Listing 5-1. Basic REST /books Resource
GET    /books       Get all the booksPOST   /books       Create a new bookGET    /books/{id}  Get a bookPUT    /books/{id}  Update a bookDELETE /books/{id}  Delete a book

Requesting an Individual Book

You are going to start off with the GET /books/{id} ...

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