title: HttpURLConnection with Parameters
body: <p>I have a URL which I pass in that looks like this </p>
  
  <pre><code>http://somecompany.com/restws/ebi/SVI/4048/?Name=Tra&amp;Brand=Software: WebSphere - Open App Servers
  </code></pre>
  
  <p>It does not like the 2nd parameter (Brand).  From a browser this querystring above works fine but as soon as I execute in Java, it fails.  When I change the webservice to accept a single parameter, then this URL works fine</p>
  
  <pre><code>http://somecompany.com/restws/ebi/SVI/4048/?Name=Tra
  </code></pre>
  
  <p>It seems java is having issues with the 2nd parameter.  I have tried escape characters and everything else I can think of but nothing seems to work.  Please Help!</p>
  
  <pre><code>String uri = "somecompany.com/restws/ebi/SVI/4048/?Name=" 
             + name+ "&amp;Brand=Software: WebSphere - Open App Servers";
  
  URL url;
  
  try {
      url = new URL(uri);
      HttpURLConnection connection = (HttpURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("Accept", "application/xml");
  }
  ...
  </code></pre>