title: preparing Json Object for HttpClient Post method
body: <p>I am trying to prepare a JSON payload to a Post method. The server fails unable to parse my data. <code>ToString()</code> method on my values would not convert it to JSON correctly, can you please suggest a correct way of doing this.</p>
  
  <pre><code>var values = new Dictionary&lt;string, string&gt;
  {
      {
          "type", "a"
      }
  
      , {
          "card", "2"
      }
  
  };
  var data = new StringContent(values.ToSttring(), Encoding.UTF8, "application/json");
  HttpClient client = new HttpClient();
  var response = client.PostAsync(myUrl, data).Result;
  using (HttpContent content = response.content)
  {
      result = response.content.ReadAsStringAsync().Result;
  }
  </code></pre>