Code example for HttpResponse

Methods: getHeaders, getStatusLine

0
	    HttpContext context = new BasicHttpContext();
 
	    HttpResponse response = httpClient.execute(httpget, context);
 
	    // If we didn't get a '302 Found' we aren't being redirected. 
	    if (response.getStatusLine().getStatusCode() != HttpStatus.SC_MOVED_TEMPORARILY)
	        throw new IOException(response.getStatusLine().toString());
 
	    org.apache.http.Header[] loc = response.getHeaders("Location");
	    return loc.length > 0 ? loc[0].getValue() : null;
	} 
	 
	public String getFileDownloadUrl(int id) {
		return baseUrl + "files/" + id + "/download" + tokenWithStuff;
	} 
	 
	public String getZipDownloadUrl(int[] id) {
		String ids = Integer.toString(id[0]);
		for (int i = 1; i < id.length; i++) {
			ids += "," + Integer.toString(id[i]);
		}