This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 15.14, “How to write a GET request web service with the Play Framework.”
You want to create a
GET request web service using the Play Framework, such as returning a JSON string when the web service URI is accessed.
When working with RESTful web services, you’ll typically be converting between one or more model objects and their JSON representation.