ServiceStack/ServiceStack — pull request #407 by bfriesen (2013-01-18 15:37:39+00:00)
Title: Add ability to intercept raw requests

At my company, for our existing services, we log each request as it comes in (the raw request body, ip address, headers, etc.). I've created a new service using Service Stack, and wanted to have this same functionality. I was surprised that this functionality didn't already exist, so I've added it (and it's entirely possible that it *does* exist - if so, feel free to reject this pull request (and show me how!)).

Here's the usage:

```c#
public class MyAppHost : AppHostBase
{
private readonly ILogger logger;

public MyAppHost(ILogger logger)
: base("My Service", typeof(MyAppHost).Assembly)
{
this.logger = logger;
}

public override void Configure(Container container)
{
InterceptRequestHandler = (IHttpRequest request) =>
{
logger.Log(new
{
Request = request.GetRawBody(),
request.RemoteIp,
request.ContentType
});
};
}
}
```