title: POST an empty body via HTTP Client
body: <p>I am trying to send an empty body to a <code>Post Request</code> but it does not execute.</p>
  
  <p>I have already tried this:</p>
  
  <p><a href="https://stackoverflow.com/questions/7907648/post-an-empty-body-to-rest-api-via-httpclient/7908243#comment51588834_7908243">Post an empty body to REST API via HttpClient</a></p>
  
  <pre><code>    static async Task&lt;string&gt; CancelSale(string mainUrl, string bearerInfo,string systemNumber)
      {
          var cancelsaleUrl = mainUrl + $"api/sale/cancel/{systemNumber}";
          client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerInfo);
          var data = new StringContent(null, Encoding.UTF8, "application/json");            
          var saleResponse = await client.PostAsync(cancelsaleUrl, data);
          var responseBody = await saleResponse.Content.ReadAsStringAsync();
          Console.WriteLine(responseBody);
  
          return responseBody;
      }
  </code></pre>
  
  <p>But it just does not execute, no exception.</p>
  
  <p>I also tried this :</p>
  
  <pre><code>        var saleResponse = await client.PostAsync(cancelsaleUrl, null);
  </code></pre>
  
  <p>which also does the same result.</p>
  
  <p>Any ideas?</p>