title: Get HTTP response message from JSON POST method in C#
body: <p>I am trying to get the response from an API but I am not getting any luck. I am running a <code>async</code> method using C# ASP.NET, but the info which comes from the <code>response</code> displays status and many things but the real response.</p>
  
  <p>This is my code:</p>
  
  <pre><code>private static async Task PostBasicAsync(CancellationToken cancellationToken)
      {
          Michael Maik = new Michael();
          Maik.name = "Michael";
          Maik.id = "114060502";
          Maik.number = "83290910";
          string Url = "http://my-api.com/testing/give-your-data";
          using (var client = new HttpClient())
          using (var request = new HttpRequestMessage(HttpMethod.Post, Url))
          {
              var json = JsonConvert.SerializeObject(Maik);
              using (var stringContent = new StringContent(
                                              json, 
                                              Encoding.UTF8, 
                                              "application/json"))
              {
                  request.Content = stringContent;
  
                  using (var response = await client
                      .SendAsync(request, 
                              HttpCompletionOption.ResponseHeadersRead,
                              cancellationToken)
                      .ConfigureAwait(false))
                  {
                      response.EnsureSuccessStatusCode();
                  }
              }
          }
      }
  </code></pre>
  
  <p>What is wrong with my code?
  It should return something like:</p>
  
  <pre><code>{
      "message": "Hi Michael we have received your data succesfully!",
      "data": {
          "name": "Michael",
          "id": "114060502",
          "number": "83290910"
      }
  }
  </code></pre>