title: Query By Wiql (WorkItem) Give Bad Request Status
body: <p>I am trying to call the post API(DevOps) for workitem but it shows me status <strong>"Bad Request".</strong></p>
  
  <p>If I call some GET API(DevOps) it's working fine. I follow the below link to call POST API:</p>
  
  <blockquote>
    <p><a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/wiql/query%20by%20wiql?view=azure-devops-rest-5.0" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/wiql/query%20by%20wiql?view=azure-devops-rest-5.0</a></p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>using (var client = new HttpClient())
                  {
                     string content = "{'query': 'Select [System.Id], [System.Title], [System.State] From WorkItems'}";
                      client.BaseAddress = new Uri("http://YYYYY.com:8080/tfs/YY");  //url of your organization
                      client.DefaultRequestHeaders.Accept.Clear();
                      client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                      client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", credentials);
                      var response = client.PostAsJsonAsync(new Uri("http://YYYYY.com:8080/tfs/YY/_apis/wit/wiql?api-version=1.0"), content).Result;
                      if (response.IsSuccessStatusCode)
                      {
                          Console.Write("Success");
                      }
                      else
                          Console.Write("Error");
                  }
  </code></pre>