title: ASP.Net Core API Accessing HttpRequestMessage
body: <p>I have a ASP.Net 4.5 application that I am trying to upgrade to ASP.Net Core.  This application receives calls from a 3rd party application.</p>
  
  <p>In my old application I have an action that looks like this:</p>
  
  <pre><code>public async Task&lt;HttpResponseMessage&gt; RealTimeAsync(HttpRequestMessage request)
  {
      var StatusMessage = string.Empty;
      try
      {
          var doc = new XmlDocument();
          doc.Load(await request.Content.ReadAsStreamAsync());
  </code></pre>
  
  <p>From 4.5 this works fine.  However, when I use this code in ASP.Net core I get an "Object Reference Not Set to an Instance of an Object" error because request.Content is null.</p>
  
  <p>The requests coming in to the two applications (4.5 and .Net Core) are the same.  Why is request.Content null in my .Net Core application?</p>
  
  <p>When I referenced this post: <a href="https://stackoverflow.com/questions/37429190/asp-net-core-httprequestmessage-returns-strange-json-message">ASP.NET Core HTTPRequestMessage returns strange JSON message</a></p>
  
  <p>I tried installing the suggested Nuget Package.  However, it is not compatible with .Net Core:</p>
  
  <blockquote>
    <p>error: Package Microsoft.AspNet.WebApi.Client 5.2.2 is not compatible
    with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package
    Microsoft.AspNet.WebApi.Client 5.2.2 supports: error: - net45
    (.NETFramework,Version=v4.5) error: -
    portable-net45+netcore45+wp8+wp81+wpa81
    (.NETPortable,Version=v0.0,Profile=wp8+netcore45+net45+wp81+‌​wpa81)
    error: One or more packages are incompatible with
    .NETCoreApp,Version=v1.0.</p>
  </blockquote>