title: setRequestProperty throwing java.lang.IllegalStateException: Cannot set request property after connection is made
body: <p>I am getting <code>java.lang.IllegalStateException</code>:</p>
  
  <p><code>java.lang.IllegalStateException</code>: Cannot set request property after connection is made error when <code>setRequestProperty</code> method is called after 
  <code>url.openConnection();</code></p>
  
  <p>Here is what i am trying:</p>
  
  <pre><code>URL url = new URL("https://49.205.102.182:7070/obsplatform/api/v1/mediadevices/545b801ce37e69cc");
           urlConnection = (HttpsURLConnection) url
          .openConnection();
  urlConnection.setRequestProperty("Content-Type","application/json");
  </code></pre>
  
  <p>any suggestions please? Thanks in advance.</p>