title: Getting query String using HttpClient 4.1
body: <p>I am migrating to Httpclient 4.1 from HttpClient 3.0
  How can I get the query String from the URL.</p>
  <pre><code>client = new DefaultHttpClient();
  
  client.getHostConfiguration().setHost( pro.getProperty( &quot;host&quot; ),
                  Integer.parseInt( pro.getProperty( &quot;port&quot; ).trim() ),
                      pro.getProperty( &quot;protocol&quot; ) );
  //client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
  
  client.getCredentialsProvider().setCredentials(
          new AuthScope( pro.getProperty( &quot;host&quot; ),
              Integer.parseInt( pro.getProperty( &quot;port&quot; ).trim() ),
                  pro.getProperty( &quot;protocol&quot; ) ),
          new UsernamePasswordCredentials( user, userpassword ) );
  
  client.getParams().setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true );
  authget = new HttpGet( pro.getProperty( &quot;getparam&quot; ) );
  HttpResponse response = client.execute( authget );
  HttpEntity entity = response.getEntity();
  </code></pre>
  <p>What should I insert here for getting the query string to match from &quot;&amp;&quot;.</p>
  <pre><code>StringTokenizer qryStrToken = new StringTokenizer(***Insert code for getting query string***,&quot;&amp;&quot;);
  
  while (qryStrToken.hasMoreTokens()){
      String temp = qryStrToken.nextToken();
      if(temp.startsWith(&quot;SMAGENTNAME&quot;)){
          smAgentName = temp.substring(temp.indexOf(&quot;=&quot;)+1);
      }
  }
  </code></pre>