title: Xamarin cannot access disposed object error
body: <p>I am using the below code to read JSON from an endpoint in my Xamarin crossplatform project and I am getting error
  Cannot read disposed object exception or it fires ObjectDisposedException</p>
  
  <p>IS it something wrong with code Can I write it in a better way ?</p>
  
  <pre><code>public async Task&lt;APISchoolDetailModel&gt; GetSchooDetailsAsync()
  {
      APISchoolDetailModel api_data = new APISchoolDetailModel();
      try
      {
          var client = new System.Net.Http.HttpClient();
          client.DefaultRequestHeaders.Add("Accept", "application/json");
          var web_client = await client.GetAsync("http://appapitest.net/APIs/Student/Schooldetails");
          var response_string= web_client.Content.ReadAsStringAsync().Result;                                              
          DataContractJsonSerializer serializer = new DataContractJsonSerializer(api_data.GetType());               
          MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(response_string));
          api_data = serializer.ReadObject(ms) as APISchoolDetailModel;
      }
      catch (Exception ex) { }            
      return api_data;
  }
  </code></pre>
  
  <p>The controller comes till the line   var web_client = await client.GetAsync(" and then its not going further and after few seconds I am getting exception</p>
  
  <p>Is any better way to write this code for reading and parsing JSON </p>