RESTful Web Services with Scala

Learn the art of creating scalable RESTful web services with Scala

RESTful Web Services with Scala

Learning
Jos Dirksen

4 customer reviews
Learn the art of creating scalable RESTful web services with Scala
$27.99
$34.99
RRP $27.99
RRP $34.99
eBook
Print + eBook

Instantly access this course right now and get the skills you need in 2017

With unlimited access to a constantly growing library of over 4,000 eBooks and Videos, a subscription to Mapt gives you everything you need to learn new skills. Cancel anytime.

Preview in Mapt

Book Details

ISBN 139781785289408
Paperback204 pages

Book Description

RESTful web services are built to work best on the web. Scala provides a rich set of language constructs and advanced frameworks that you can use to create REST services. However, using Scala and these tools can be a complex task. There are many frameworks available and choosing the wrong framework or approach can cost a lot of time and lead to much frustration. By exploring the most popular Scala REST frameworks, you can make sure you choose the right tool.

RESTful Web Services with Scala begins with a brief explanation of the REST architecture and its implementation in Scala, as well as the impact that REST architecture has on Scala applications. You will understand the advantages of building Scala web services and how existing Scala applications can take advantage of REST. This book will teach developers about the different programming paradigms available in the Scala world to create RESTful services by exploring the most popular Scala-oriented REST frameworks. It discusses the various facets of RESTful web services such as building scalable APIs, working with standards like HTTP and MIME, designing the architecture, securing the web service, and more.

With this book, you will be able to build RESTful web services with various Scala frameworks such as Finch, Unfiltered, Scalatra, Akka-HTTP, and Play. You will create basic REST services using frameworks and then extend the REST services with custom functionality. By the end of the book, you'll be able to decide which framework is best suited for your requirements. We finish by looking at how we can use a number of advanced features provided by these frameworks, such as security, creating HTTP clients, working with HATEOAS, and more.

Table of Contents

Chapter 1: Getting Started with RESTful Web Services
Introduction to the REST framework
Getting the source code
Setting up Scala and SBT to run the examples
Setting up the IDE
Testing the REST API
The REST service and model
Summary
Chapter 2: A Functional-style REST Service with Finagle and Finch
An introduction to Finagle and Finch
Building your first Finagle and Finch REST service
HTTP verb and URL matching
Processing incoming requests using RequestReaders
JSON support
Request validation and custom responses
Summary
Chapter 3: A Pattern-matching Approach to REST Services with Unfiltered
What is Unfiltered
Your first Unfiltered service
HTTP verb and URL matching
Extracting request parameters and using futures for asynchronous responses
Adding validation to parameter processing
Summary
Chapter 4: An Easy REST Service Using Scalatra
Introduction to Scalatra
Your first Scalatra service
Verb and path handling
Add support for futures and simple validation
Advanced validation and JSON support
Summary
Chapter 5: Defining a REST Service Using Akka HTTP DSL
What is Akka HTTP?
Creating a simple DSL-based service
Working with paths and directives
Processing request parameters and customizing the response
Exception handling and rejections
Adding JSON support
Summary
Chapter 6: Creating REST Services with the Play 2 Framework
An introduction to the Play 2 framework
Hello World with Play 2
Working with the routes file
Adding the Future support and output writers
Adding JSON marshalling, validations, and error handling
Summary
Chapter 7: JSON, HATEOAS, and Documentation
Working with JSON
HATEOAS
Summary

What You Will Learn

  • Set up a development environment to easily develop and test REST services
  • Discover the different ways in which you can create REST services with Scala
  • See and explore the different approaches taken by popular REST frameworks
  • Get to know more about a variety of available Scala frameworks such as Finch, Unfiltered, Scalatra, Akka-HTTP, and Play
  • Discover how to create a REST service on top of each framework discussed in this book
  • Create HTTP clients using the frameworks in this book
  • Make an informed decision about which framework to use in a specific situation
  • Set up authentication for your REST services

Authors

Table of Contents

Chapter 1: Getting Started with RESTful Web Services
Introduction to the REST framework
Getting the source code
Setting up Scala and SBT to run the examples
Setting up the IDE
Testing the REST API
The REST service and model
Summary
Chapter 2: A Functional-style REST Service with Finagle and Finch
An introduction to Finagle and Finch
Building your first Finagle and Finch REST service
HTTP verb and URL matching
Processing incoming requests using RequestReaders
JSON support
Request validation and custom responses
Summary
Chapter 3: A Pattern-matching Approach to REST Services with Unfiltered
What is Unfiltered
Your first Unfiltered service
HTTP verb and URL matching
Extracting request parameters and using futures for asynchronous responses
Adding validation to parameter processing
Summary
Chapter 4: An Easy REST Service Using Scalatra
Introduction to Scalatra
Your first Scalatra service
Verb and path handling
Add support for futures and simple validation
Advanced validation and JSON support
Summary
Chapter 5: Defining a REST Service Using Akka HTTP DSL
What is Akka HTTP?
Creating a simple DSL-based service
Working with paths and directives
Processing request parameters and customizing the response
Exception handling and rejections
Adding JSON support
Summary
Chapter 6: Creating REST Services with the Play 2 Framework
An introduction to the Play 2 framework
Hello World with Play 2
Working with the routes file
Adding the Future support and output writers
Adding JSON marshalling, validations, and error handling
Summary
Chapter 7: JSON, HATEOAS, and Documentation
Working with JSON
HATEOAS
Summary

Book Details

ISBN 139781785289408
Paperback204 pages
Read More
From 4 reviews

Read More Reviews