The reason nothing was being returned to res was that the stream position was set to the end of the Request content, not the beginning. Also, the response was faulting because the base.SendAsync method was not being properly awaited.
Proper implementation below:
public class ContentValidationHandler : DelegatingHandler
{
private static log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)
{
var response = await base.SendAsync(request, cancellationToken);
Stream strea = new MemoryStream();
await request.Content.CopyToAsync(strea);
strea.Position = 0;
StreamReader reader = new StreamReader(strea);
String res = reader.ReadToEnd();
Log.Info("request content: " + res);
return response;
//
}
}