Code example for URLConnection

Methods: setRequestProperty

	private URLConnection connect(String surl) throws MalformedURLException, IOException
		URL url = new URL(surl);
		URLConnection conn = url.openConnection();
		conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=" + CHARSET);
		conn.setRequestProperty("User-Agent", "DH Manager by Andreas H. and Michael V.");
		conn.setRequestProperty("Cookie", DUALIS_COOKIE);
		return conn;
	 * Generiert einen zufälligen cookie 
	 * @return Cookie 
	private static String generateCookie()
		String cookie = "";
		StringBuilder stringBuilder = new StringBuilder();
Stop searching for code, let great code find you!  Add Codota to your java IDE