get request

How to write a GET request web service with the Play Framework

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.”

Problem

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.

Solution

When working with RESTful web services, you’ll typically be converting between one or more model objects and their JSON representation.

How to write a simple HTTP GET request client in Scala (with a timeout)

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 15.9, “How to write a simple HTTP GET request client in Scala.”

Back to top

Problem

You want an HTTP client you can use to make GET request calls.

Back to top

Solution

There are many potential solutions to this problem. This recipe demonstrates three approaches:

Table of Contents

  1. Problem
  2. Solution
Back to top