Example #1
0
        public async Task BufferResponseAsync()
        {
            if (IsResponseBuffered)
            {
                return;
            }

            if (ResponseBody == null)
            {
                return;
            }

            var ms = new MemoryStream();

            await ResponseBody.CopyToAsync(ms);

            ResponseBody = ms;
            ms.Seek(0, SeekOrigin.Begin);

            IsResponseBuffered = true;
        }