Book Image

ServiceStack 4 Cookbook

Book Image

ServiceStack 4 Cookbook

Overview of this book

Table of Contents (18 chapters)
ServiceStack 4 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Splitting HTTP request methods


When you're building a REST service, it's good practice to make efficient use of the HTTP protocol to assist you in your design. While full coverage of what makes for good RESTful design is outside the scope of this book, we will cover how to use ServiceStack's built-in tools to help you reuse code.

Note

I recommend REST in Practice, O'Reilly, and APIs: A Strategy Guide, O'Reilly, for more on designing effective RESTful web services.

One project I am acquainted with started out with an RPC-style design. The service owner realized that they had well over 65 endpoints, such as /createNewGroup, /renameGroup, and so on, making it hard for developers to remember the exact name of the endpoint for the function they need. This was overhauled, and the RESTful approach was applied. The end result had only four endpoints and still served the same user base with the same functionality. The end result was a much simpler service that was easier to learn, deploy, and debug...