O'Reilly logo

RESTful Web Services with Scala by Jos Dirksen

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

Verb and path handling

Now that we've got our basic Scalatra REST service running, let's look at a more elaborate example, which we'll use to explore some more features of Scalatra. Before we look at the code, let's make a request from Postman. First, start the server by calling sbt runCH04-runCH04Step1 from the console, which shows something similar to this:

$ sbt runCH04-runCH04Step1
[info] Loading project definition from /Users/jos/dev/git/rest-with-scala/project
[info] Set current project to rest-with-scala (in build file:/Users/jos/dev/git/rest-with-scala/)
[info] Running org.restwithscala.chapter4.steps.ScalatraRunnerStep1 
10:51:40.313 [run-main-0] INFO o.e.jetty.server.ServerConnector - Started ServerConnector@538c2499{HTTP/1.1}{0.0.0.0:8080} ...

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