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

Utilizing the original HTTP request


There are a few types of situations when you might need to access the original ASP.NET HttpRequest. You might be migrating to ServiceStack from a large existing WCF code base or another framework where this object was used a lot. You might be required to integrate with a legacy or custom services/clients that are unable to be changed, and your web service endpoints must adhere to a specific set of requests and responses. In this recipe, we will go over some of the options you have when using the ServiceStack framework—the access and use of the original HTTP request object as well as some ways you can leverage how ServiceStack binds values to your request data transfer objects.

Getting ready

You'll need to have your ServiceStack project up and running; please see Creating a ServiceStack solution with VisualStudio and NuGet in Appendix A, Getting Started.

How to do it…

Accessing the original ASP.NET HttpRequest is very simple to do as it's exposed from your...