public static string GetAsString(this Nancy.IO.RequestStream stream) { stream.Position = 0; using (var streamReader = new StreamReader(stream)) { return(streamReader.ReadToEnd()); } }
private static string GetBodyString(Nancy.IO.RequestStream body) { int length = (int)body.Length; //this is a dynamic variable. byte[] data = new byte[length]; body.Read(data, 0, length); return(System.Text.Encoding.Default.GetString(data)); }