title: Get response Uri from apache HttpResponse and parse it (java)
body: <p>I need to get the response uri from the HttpResponse and parse it into name-value pairs.
  I need the analog for the following .NET fragment:</p>
  
  <pre><code>string authorizationRequestParameters = string.Format("client_id={0}&amp;response_type=code&amp;scope={1}&amp;access_type=offline", ClientID, Scope);
  Uri authorizationRequestUri = new Uri(OauthHost.AbsoluteUri + "?" + authorizationRequestParameters);
  HttpWebResponse authorizationResponse = DoGet(authorizationRequestUri, cookies);
  NameValueCollection authorizeResponseParameters = HttpUtility.ParseQueryString(authorizationResponse.ResponseUri.Query);
  string callbackCode = authorizeResponseParameters["code"];
  </code></pre>
  
  <p>The necessary condition is, that in Java version DoGet method returns apache HttpResponse.
  The way I tried to do this:</p>
  
  <pre><code>HttpResponse resp = hch.doGet("http://...?client_id=...&amp;response_type=...&amp;scope=...&amp;access_type=...");
  HttpEntity entity = resp.getEntity();
  InputStream instream = entity.getContent();
  System.out.print(IOUtils.toString(instream, "UTF-8"));
  </code></pre>
  
  <p>I can receive the html-content this way, but I need just response Uri, the part of it, that contains parameters.
  How can I do that?</p>