April 2017
Intermediate to advanced
316 pages
9h 33m
English
Our post call returns a list of items. Also, we can get items with this:
/// List todo items drop.get("todos") { request in let todos = TodoStore.sharedInstance let json: [Todo] = todos.listItems() return try JSON(node: json) }
We will build and run our application with Vapor CLI again and we can test this get request as follows:
curl -X "GET" "http://localhost:8080/todos" \ -H "Cookie: test=123"
Read now
Unlock full access