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

JSON support

So far, we've just worked with plain strings as responses. In this section, we'll expand the previous sample and add JSON support and show you how you can control which HTTP response code should be used when handling a request. Using JSON with Finch is very straightforward since Finch already supports a number of JSON libraries out of the box:

Argonaut

In this section, we'll look at how to use the Argonaut library to automatically convert our model (our case classes) to JSON. Should you want to use one of the other libraries, they work in pretty much the same manner.

We'll start by looking at the request and response message that our ...

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