This method, forms the http GET request, applies on the netscaler.
Reads the response from the netscaler and converts it to corresponding
resource type.
@param service
@param option
@return Array of requested resources.
424458
private  base_resource[] get_request(nitro_service service,options option) throws Exception  
	{
		StringBuilder responseStr = new StringBuilder();
		HttpURLConnection httpURLConnection = null;
		try
		{
			String urlstr;
			String ipaddress = service.get_ipaddress();
			String version = service.get_version();
			String sessionid = service.get_sessionid();
			String objtype = get_object_type();
			String protocol = service.get_protocol();

			// build URL
			urlstr = protocol + "://" + ipaddress + "/nitro/" + version + "/config/" + objtype;

			String name = this.get_object_name();
			if (name != null && name.length() > 0)
			{
				urlstr = urlstr+"/"+nitro_util.encode(nitro_util.encode(name));
			}

			if (option != null || (service.get_warning()!=null && service.get_warning()) )
			{
				String optionstr=null;
				if (option != null)
				{
					optionstr = option.to_string();
					if (optionstr.length() > 0)
					{
						urlstr = urlstr+"?";
						urlstr = urlstr+optionstr;
					}
				}	
				if (service.get_warning()!=null && service.get_warning())
				{					
					if (option != null && optionstr.length() > 0)
					{
						urlstr = urlstr+"&";
					}
					else
					{
						urlstr = urlstr+"?";
					}
					urlstr = urlstr+"warning=yes";
				}
			}
			
			
			URL url = new URL(urlstr);
			httpURLConnection = (HttpURLConnection) url.openConnection();

			httpURLConnection.setRequestMethod("GET");

			httpURLConnection.setRequestProperty("Cookie", "sessionid=" + nitro_util.encode(sessionid));
			if ((option != null) && (option.get_compression()))
				httpURLConnection.setRequestProperty("Accept-Encoding", "gzip, deflate");

			if (httpURLConnection instanceof HttpsURLConnection)
			{
				if (service.get_certvalidation()) {
					SocketFactory sslSocketFactory = SSLSocketFactory.getDefault();
					HttpsURLConnection secured = (HttpsURLConnection) httpURLConnection;
					secured.setSSLSocketFactory((SSLSocketFactory)sslSocketFactory);	
					if (!service.get_hostnameverification()) {
						/*
						 * override defualt hostNameverifier's verify method
						 * with EmptyHostnameVerifier's verify method to ignore hostname verification check.
						 */
						secured.setHostnameVerifier(new EmptyHostnameVerifier());
					}
				} else {
					SSLContext sslContext = SSLContext.getInstance("SSL");
					//we are using an empty trust manager, because NetScaler currently presents
					//a test certificate not issued by any signing authority, so we need to bypass
					//the credentials check
					sslContext.init(null, new TrustManager[]{new EmptyTrustManager()}, null);
					SocketFactory sslSocketFactory = sslContext.getSocketFactory();
					
					HttpsURLConnection secured = (HttpsURLConnection) httpURLConnection;
					secured.setSSLSocketFactory((SSLSocketFactory)sslSocketFactory);
					if (!service.get_hostnameverification()) {
						/*
						 * overriding defualt hostNameverifier's verify method
						 * with EmptyHostnameVerifier's verify method to bypass hostname check.
						 */
						secured.setHostnameVerifier(new EmptyHostnameVerifier());
					}
				}
			}
			
			InputStream input;
			try {
				input = httpURLConnection.getInputStream();
			}
			catch (Exception e) {
				input = httpURLConnection.getErrorStream();	
			}
			String contentEncoding = httpURLConnection.getContentEncoding();
			//	get correct input stream for compressed data:
			if (contentEncoding != null)
			{
				if(contentEncoding.equalsIgnoreCase("gzip"))
					input = new GZIPInputStream(input); //reads 2 bytes to determine GZIP stream!
				else if(contentEncoding.equalsIgnoreCase("deflate"))
					input = new InflaterInputStream(input);
			}

			int numOfTotalBytesRead;
			byte [] buffer = new byte[1024];
			while ((numOfTotalBytesRead = input.read(buffer, 0, buffer.length)) != -1)
			{
				responseStr.append(new String(buffer, 0, numOfTotalBytesRead));
			}

			httpURLConnection.disconnect();
			input.close();
		}
		catch (MalformedURLException mue)
		{
			throw mue;
		}
		catch (IOException ioe)
		{
			throw ioe;
			
		}
		catch(Exception e)
		{
			throw e;
		}
		base_resource[] result = get_nitro_response(service, responseStr.toString());
		return result;
	}
1070457
public static Interface[] get(nitro_service service) throws Exception{
		Interface obj = new Interface();
		Interface[] response = (Interface[])obj.get_resources(service);
		return response;
	}
1307812
public static spilloveraction[] get(nitro_service service, options option) throws Exception{
		spilloveraction obj = new spilloveraction();
		spilloveraction[] response = (spilloveraction[])obj.get_resources(service,option);
		return response;
	}
866348
public static scparameter get(nitro_service service,  options option) throws Exception{
		scparameter obj = new scparameter();
		scparameter[] response = (scparameter[])obj.get_resources(service,option);
		return response[0];
	}
901521
public static arp[] get(nitro_service service) throws Exception{
		arp obj = new arp();
		arp[] response = (arp[])obj.get_resources(service);
		return response;
	}
77977
public static cacheselector[] get(nitro_service service, options option) throws Exception{
		cacheselector obj = new cacheselector();
		cacheselector[] response = (cacheselector[])obj.get_resources(service,option);
		return response;
	}
256186
public static service get(nitro_service service, String name) throws Exception{
		service obj = new service();
		obj.set_name(name);
		service response = (service) obj.get_resource(service);
		return response;
	}
892529
protected base_resource[] stat_resources(nitro_service service,options option) throws Exception
	{
		if (!service.isLogin())
			service.login();

		base_resource[] response = stat_request(service, option);
		return response;
	}
1325161
public static appfwjsoncontenttype[] get(nitro_service service, options option) throws Exception{
		appfwjsoncontenttype obj = new appfwjsoncontenttype();
		appfwjsoncontenttype[] response = (appfwjsoncontenttype[])obj.get_resources(service,option);
		return response;
	}
40370
public static sslservice[] get(nitro_service service, sslservice_args args) throws Exception{
		sslservice obj = new sslservice();
		options option = new options();
		option.set_args(nitro_util.object_to_string_withoutquotes(args));
		sslservice[] response = (sslservice[])obj.get_resources(service, option);
		return response;
	}
148962
public static appqoecustomresp[] get(nitro_service service, options option) throws Exception{
		appqoecustomresp obj = new appqoecustomresp();
		appqoecustomresp[] response = (appqoecustomresp[])obj.get_resources(service,option);
		return response;
	}
940059
public static gslbsite[] get(nitro_service service, options option) throws Exception{
		gslbsite obj = new gslbsite();
		gslbsite[] response = (gslbsite[])obj.get_resources(service,option);
		return response;
	}
48356
public static snmpoption get(nitro_service service) throws Exception{
		snmpoption obj = new snmpoption();
		snmpoption[] response = (snmpoption[])obj.get_resources(service);
		return response[0];
	}
1257265
public static nsconsoleloginprompt get(nitro_service service,  options option) throws Exception{
		nsconsoleloginprompt obj = new nsconsoleloginprompt();
		nsconsoleloginprompt[] response = (nsconsoleloginprompt[])obj.get_resources(service,option);
		return response[0];
	}
430099
protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
		protocoltcp_stats[] resources = new protocoltcp_stats[1];
		protocoltcp_response result = (protocoltcp_response) service.get_payload_formatter().string_to_resource(protocoltcp_response.class, response);
		if(result.errorcode != 0) {
			if (result.errorcode == 444) {
				service.clear_session();
			}
			if(result.severity != null)
			{
				if (result.severity.equals("ERROR"))
					throw new nitro_exception(result.message,result.errorcode);
			}
			else
			{
				throw new nitro_exception(result.message,result.errorcode);
			}
		}
		resources[0] = result.protocoltcp;
		return resources;
	}
1031040
protected base_resource[] getfiltered(nitro_service service,options option) throws Exception
	{
		if (!service.isLogin())
			service.login();
		base_resource[] response = get_request(service, option);
		return response;
	}
1241725
public static nspbr[] get(nitro_service service) throws Exception{
		nspbr obj = new nspbr();
		nspbr[] response = (nspbr[])obj.get_resources(service);
		return response;
	}