title: req.Content.ReadAsStringAsync().Result always returns null when accessed from browser (but not in Azure Portal)
body: <p>Below contains my full code (Azure Function App on Azure Portal). Take extra attention on these two lines.</p>
  
  <p><code>var jsonContent = req.Content.ReadAsStringAsync().Result;
   log.LogInformation("jsonContent" + jsonContent);
  </code></p>
  
  <p>When I test the function using the <strong>request body</strong> under panel on the right, the <code>jsonContent</code> is printed out in the Logs as it should. However, using the <strong>function url</strong> in a browser, and append it with <code>&amp;name=azure</code>, the <code>jsonContent</code> is null as shown in the Logs.</p>
  
  <pre class="lang-cs prettyprint-override"><code>//full code
  #r "Newtonsoft.Json"
  using System.Net;
  using Newtonsoft.Json;
  using System.Text;
  
  using System.IO;
  using System.Net.Http;
  using System.Net.Http.Headers;
  using System.Web;
  
  public static async Task&lt;HttpResponseMessage&gt; Run(HttpRequestMessage req, ILogger log)
  {
      // these two lines are problematic???
      var jsonContent = req.Content.ReadAsStringAsync().Result;
      log.LogInformation("jsonContent" + jsonContent);
  
      // you can ignore the following lines (not related to question)
      string jsonToReturn = "Hello World";
  
      return new HttpResponseMessage(HttpStatusCode.OK) {
          Content = new StringContent(jsonToReturn, Encoding.UTF8, "application/json")
      };
  }
  </code></pre>
  
  <p>I tried changing the line to this but it didn't work either.</p>
  
  <p><code>var jsonContent = await req.Content.ReadAsStringAsync().Result;</code></p>
  
  <p>The error is something like </p>
  
  <p><code>'string' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)</code></p>
  
  <p>Anyway, I know a workaround that is to use <code>HttpRequest</code> instead of <code>HttpRequestMessage</code> to generate <code>jsonContent</code>, but I'm just curious why the case doesn't work.</p>
  
  <p>Can anyone spot my mistake? Thanks!</p>