title: Setting custom HTTP request headers in an URL object doesn't work
body: <p>I am trying to fetch an image from an IP camera using HTTP. The camera requires HTTP basic authentication, so I have to add the corresponding request header:</p>
  
  <pre><code>URL url = new URL("http://myipcam/snapshot.jpg");
  URLConnection uc = url.openConnection();
  uc.setRequestProperty("Authorization", 
    "Basic " + new String(Base64.encode("user:pass".getBytes())));
  
  // outputs "null"
  System.out.println(uc.getRequestProperty("Authorization"));
  </code></pre>
  
  <p>I am later passing the <code>url</code> object to <code>ImageIO.read()</code>, and, as you can guess, I am getting an HTTP 401 Unauthorized, although <code>user</code> and <code>pass</code> are correct.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>I've also tried <code>new URL("http://user:pass@myipcam/snapshot.jpg")</code>, but that doesn't work either.</p>