title: HttpURLConnection sends a POST request even though httpCon.setRequestMethod("GET"); is set
body: <p>Here is my code:</p>
  
  <pre><code>String addr = "http://172.26.41.18:8080/domain/list";
  
  URL url = new URL(addr);
  HttpURLConnection httpCon = (HttpURLConnection) url.openConnection();
  httpCon.setDoOutput(true);
  httpCon.setDoInput(true);
  httpCon.setUseCaches(false);
  httpCon.setAllowUserInteraction(false);
  httpCon.setRequestMethod("GET");
  httpCon.addRequestProperty("Authorization", "Basic YWRtaW4fYFgjkl5463");
  
  httpCon.connect();
  
  OutputStreamWriter out = new OutputStreamWriter(httpCon.getOutputStream());
  
  System.out.println(httpCon.getResponseCode());
  System.out.println(httpCon.getResponseMessage());
  
  out.close();
  </code></pre>
  
  <p>What I see in response: </p>
  
  <blockquote>
    <p>500 Server error</p>
  </blockquote>
  
  <p>I open my <code>httpCon</code> var, and what I see: </p>
  
  <blockquote>
    <p>POST /rest/platform/domain/list HTTP/1.1 </p>
  </blockquote>
  
  <p>Why is it set to POST even though I have used <code>httpCon.setRequestMethod("GET");</code> to set it to GET?</p>