title: Retrieve POST Request Body of Http client in C#
body: <p>Any way to retrieve the POST Request Body of Http Client in C#? I just want to check in my UT if my extension method is adding it properly to the request or not. This function is not doing any justice to it.</p>
  
  <pre><code>public static async Task&lt;string&gt; AddPostRequestBody&lt;T&gt;(this HttpClient httpclient, string RequestUrl, T classobject)
      {
          string json_body = Newtonsoft.Json.JsonConvert.SerializeObject(classobject);
          HttpRequestMessage RequestMessage = new HttpRequestMessage(HttpMethod.Post, RequestUrl);
          HttpResponseMessage response = await httpclient.PostAsync(RequestUrl, new StringContent(json_body));
          response = httpclient.SendAsync(RequestMessage).Result;
          string outputresult = await response.RequestMessage.Content.ReadAsStringAsync();
          return outputresult;
      }
  </code></pre>
  
  <p>Please help !</p>