title: How to read HttpResponseContent as Stream using system.net.http
body: <p>I have a piece of code to read <code>HttpResponseContent</code> using <code>windows.web.http</code>:</p>
  
  <pre><code>        using System.IO;
          using Windows.Web.Http;
          using Newtonsoft.Json;
  
          var responseContent = JsonConvert.DeserializeObject&lt;HttpResponseContent&gt;(response.Content.ToString());
          if (response.StatusCode == HttpStatusCode.Ok) 
          {
              //convert only from this line
              using (var input =
                  await response.Content.ReadAsInputStreamAsync()
                                        .AsTask()
                                        .ConfigureAwait(false))
              using (var stream = input.AsStreamForRead())
              using (StreamReader sr = new StreamReader(stream))
              using (JsonReader reader = new JsonTextReader(sr)) //to this line
          {
                  return DeserializeData(reader);
          }
  </code></pre>
  
  <p><strong>Question 1</strong>: How can I achieve this using <code>system.net.http</code> namespace?</p>
  
  <p>Note: I wrote those codes in <code>uwp</code> using <code>windows.web.http</code>, what I want is to convert that code using different package/namespace, which is <code>system.net.http</code> which I am using in Azure Functions.</p>
  
  <p><strong>Reference Link:</strong> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.http?view=netframework-4.7.2" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/api/system.net.http?view=netframework-4.7.2</a> <a href="https://docs.microsoft.com/en-us/uwp/api/windows.web.http" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/uwp/api/windows.web.http</a></p>
  
  <p>Thanks</p>