title: Request body from is empty in .Net Core 3.0
body: <p>Okay so I've been wracking my brain and cannot for the life of me understand why the exact same piece of code works perfectly in .Net Core 2.2 but returns an empty string in .Net Core 3.0.</p>
  
  <p>The piece of code I am running is this:</p>
  
  <pre><code>public static async Task&lt;string&gt; GetRequestBodyAsync(this HttpRequest request,
                                                       Encoding encoding = null)
  {
      if (encoding == null) encoding = Encoding.UTF8;
      var body = "";
  
      request.EnableBuffering();
      if (request.ContentLength == null || !(request.ContentLength &gt; 0) || !request.Body.CanSeek) return body;
  
      request.Body.Seek(0, SeekOrigin.Begin);
      using (var reader = new StreamReader(request.Body, encoding, true, 1024, true))
          body = await reader.ReadToEndAsync();
  
      request.Body.Position = 0;
      return body;
  }
  </code></pre>
  
  <p>And I call this extension as such:</p>
  
  <pre><code>var bodyContent = await Request.GetRequestBodyAsync();
  var body = new MemoryStream(Encoding.UTF8.GetBytes(bodyContent));
  </code></pre>
  
  <p>In .Net Core 2.2 I get the body of the sent payload exactly as I want it, but in .Net Core 3.0 I get an empty string.</p>
  
  <p>I am using the extension in my startup to add Newtonsoft to my project for .Net Core 3.0, but if I remove that it still doesn't work.</p>
  
  <p>Any ideas what I might've done wrong?</p>