private static void ConvertNancyResponseToResponse(Response nancyResponse, string filePath)
{
using (var output = new MemoryStream())
{
nancyResponse.Contents.Invoke(output);
output.Flush();
output.Position = 0;
using (var reader = new StreamReader(output))
{
File.WriteAllText(filePath, reader.ReadToEnd());
}
}
}