title: HttpClient problem with URLs which include curly braces
body: <p>I am using HttpClient for my android application. At some point, I have to fetch data from remote locations. Below is the snippet how I made use of HttpClient to get the response. </p>
  
  <pre><code>String url_s = "https://mydomain.com/abc/{5D/{B0blhahblah-blah}I1.jpg"; //my url string
  DefaultHttpClient httpClient = new DefaultHttpClient();
  response = httpClient.execute(new HttpGet(url_s));
  </code></pre>
  
  <p>It works absolutely fine in most cases but not when there is some curly braces in my url which is String basically. The stack trace shows me the index of curly braces saying Invalid character. 
  So I tried to create URI from encoded URL. </p>
  
  <pre><code>URL url = new URL(url_s);
  URI uri = url.toURI();
  response = httpClient.execute(new HttpGet(uri));
  </code></pre>
  
  <p>After doing so, i didn't get the result from remote location at all. I worked around the problem and fixed it by replacing the curly brace</p>
  
  <ul>
  <li>"{" with "%7B"</li>
  <li>"}" with "%7D"</li>
  </ul>
  
  <p>But I am not totally satisfy with my solution. Are there any better solutions? Anything neat and not hard-coded like mine?</p>