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; }