title: Convert Json from HttpResponseMessage to string
body: <p>I've got code like this:</p>
  
  <pre><code> private void button1_Click(object sender, EventArgs e)
      {
          HttpClient client = new HttpClient();
          client.BaseAddress = new Uri("http://localhost:8080/");
          client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
          HttpResponseMessage response = client.GetAsync("api/values/1").Result;
          if (response.IsSuccessStatusCode)
          {
              var Samochod = response.Content.ReadAsAsync&lt;Samochod&gt;().Result;
              MessageBox.Show("Car ID: " + Samochod.CarID + ", Car Brand: " + Samochod.Marka);
          }
          else
          {
              MessageBox.Show("False");
          }
      }
  </code></pre>
  
  <p>but I'm receiving error in line</p>
  
  <pre><code>var Samochod = response.Content.ReadAsAsync&lt;Samochod&gt;().Result;
  </code></pre>
  
  <p>Can I convert a Json object from <code>HttpResponseMessage</code> response to a string? I was trying to do:</p>
  
  <pre><code>string value = response.ToString();
  </code></pre>
  
  <p>But it's nonsense. I have to know what is in Json file I'm receiving from Web API. After that I will know, how to fix error.</p>
  
  <p>Edit:</p>
  
  <p>The problem is, when I'm putting "localhost:8080/api/values/1" directly into browsers, the output is:</p>
  
  <pre><code>{"CarID":1,"Marka":"Daewoo","Model":"Lanos","Kolor":"Zielony"`
  </code></pre>
  
  <p>, but when I'm doing this by Win Form application, I'm receing: </p>
  
  <pre><code>\"{\"CarID\":1,\"Marka\":\"Daewoo\",\"Model\":\"Lanos\",\"Kolor\":\"Zielony\"}\" 
  </code></pre>
  
  <p>And error: "A first chance exception of type 'System.AggregateException' occurred in mscorlib.dll. And Inner Exception in View detail: </p>
  
  <pre><code>{"Error converting value \"{\"CarID\":1,\"Marka\":\"Daewoo\",\"Model\":\"Lanos\",\"Kolor\":\"Zielony\"}\" to type 'WebAPIwinForms.Samochod'. Path '', line 1, position 78."}
  </code></pre>