title: Bad Request Error HttpClient
body: <p>I have the following implementation. It works actually. However, when I restart wcf service and call the HTTPClient again as follows, then I get a bad request error.</p>
  
  <p><strong>Error message:</strong></p>
  
  <pre><code>StatusCode: 400,  
  ReasonPhrase: 'Bad Request',  
  Version: 1.1, 
  Content: System.Net.Http.StreamContent, 
  Headers: { cache-control: private transfer-encoding: chunked server: Microsoft-IIS/10.0 x-aspnet-version: 4.0.30319 x-sourcefiles:
  =?UTF-8?B?QsrdfeterRk1cU2VydmVyXEFwcGxpY2F0aW9uIFNlcnZlclxGaWVsZCBSZXBvcnRlclxPcHNDZW50ZXIuTW9iaWxlLlN5bmNcTW9iaWxlRmllbGRTZXJ2aWNlLnN2Y1xEb3d511454eredefew==?= x-powered-by: ASP.NET date: Tue, 06 Feb 2018 16:54:43 GMT connection: close content-type: text/html }}
  </code></pre>
  
  <p><strong>Code implementation</strong></p>
  
  <pre><code>private static T GoRequest&lt;T&gt;(string url, Dictionary&lt;string, object&gt; parameters, HttpMethod method, string body = "") where T : class
  {
     using (var httpClient = new HttpClient(new HttpClientHandler()))
     {
       var request = new HttpRequestMessage(method, requestUri);
       if (body != string.Empty)
       {
          request.Content = new StringContent(body, Encoding.UTF8, "application/json");
       }
  
        try
        {
          using (var response = httpClient.SendAsync(request).Result)
          {
            Console.WriteLine(response);
          }
          catch (Exception ex)
          {
            Console.WriteLine(ex.Message);
          }
         }
      }
  }
  </code></pre>