public static HttpURLConnection HTTPConnect(URL urlToConnect, String method, String jsonText) throws IOException{

		HttpURLConnection conn = (HttpURLConnection) urlToConnect.openConnection();
		
		//Set token for open connection to Openstack
		conn.addRequestProperty("X-Auth-Token", OpenstackNetProxyConstants.TOKEN);
		conn.setRequestMethod(method);

		switch (method) {
		case OpenstackNetProxyConstants.HTTP_METHOD_GET:  
			conn.setRequestProperty(OpenstackNetProxyConstants.HTTP_KEY_ACCEPT, MediaType.APPLICATION_JSON);
			break;
		case OpenstackNetProxyConstants.HTTP_METHOD_POST: 
			conn.setDoOutput(true);
			conn.setRequestProperty(OpenstackNetProxyConstants.HTTP_KEY_CONTENT_TYPE, MediaType.APPLICATION_JSON);
			sendJsonContent(jsonText, conn);
			break;
		case OpenstackNetProxyConstants.HTTP_METHOD_PUT: 
			conn.setDoOutput(true);
			conn.setDoInput(true);
			conn.setRequestProperty(OpenstackNetProxyConstants.HTTP_KEY_CONTENT_TYPE, MediaType.APPLICATION_JSON);
			conn.setRequestProperty(OpenstackNetProxyConstants.HTTP_KEY_ACCEPT, MediaType.APPLICATION_JSON);
			sendJsonContent(jsonText, conn);
			break;
		case OpenstackNetProxyConstants.HTTP_METHOD_DELETE:
			break;
		}
		
		//Response code control
		if (conn.getResponseCode()>=200 & conn.getResponseCode()<=206)System.out.println("HTTP Response code: "+conn.getResponseCode());
		else {
			System.out.println("URL: "+conn.getURL());
			throw new RuntimeException(OpenstackNetProxyConstants.MESSAGE_FAIL_HTTP_CONNECTION + conn.getResponseCode());
		}

		return conn;
	}