RESTful Web Services with Scala

Learn the art of creating scalable RESTful web services with Scala

RESTful Web Services with Scala

Jos Dirksen

2 customer reviews
Learn the art of creating scalable RESTful web services with Scala
Mapt Subscription
FREE
$29.99/m after trial
eBook
$19.60
RRP $27.99
Save 29%
Print + eBook
$34.99
RRP $34.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$19.60
$34.99
$29.99p/m after trial
RRP $27.99
RRP $34.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
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 2 reviews

Read More Reviews

Recommended for You

Learning Concurrent Programming in Scala Book Cover
Learning Concurrent Programming in Scala
$ 26.99
$ 18.90
Scala for Machine Learning Book Cover
Scala for Machine Learning
$ 35.99
$ 25.20
Mastering Play Framework for Scala Book Cover
Mastering Play Framework for Scala
$ 39.99
$ 28.00
Machine Learning with Spark Book Cover
Machine Learning with Spark
$ 29.99
$ 3.00
Spark Cookbook Book Cover
Spark Cookbook
$ 35.99
$ 25.20
Scala Design Patterns Book Cover
Scala Design Patterns
$ 43.99
$ 30.80