title: SonarQube Java Web API
body: <p>I want to create QualityGates with the Web API in java.</p>
  <pre><code>        String auth = username + &quot;:&quot; + password;
          String authEncoded = Base64.getEncoder().encodeToString(auth.getBytes());
          URL sonar = new URL(&quot;http://xxx.xxx.xxx.xx:9000/api/qualitygates/create&quot;);
          HttpURLConnection conn = (HttpURLConnection) sonar.openConnection();
          conn.setRequestMethod(&quot;POST&quot;);
          conn.setRequestProperty(&quot;Authorization&quot;, &quot;Basic &quot; + authEncoded);
  </code></pre>
  <p>I dont seem to find anything in the topic of POST to web API.
  In the Code i basically try to connect to the API with the Admin user authentication.
  The Problem is, it doesnt matter what i do i always get ResponseCode 400. I know that it needs a name as a Property to create the QualityGate but that also doesnt seem to work.</p>
  <p>My Question:
  What do i need to do to use the POST method on web API's.</p>
  <p>Best regards!</p>