Code example for URLConnection

Methods: addRequestProperty, connect, getInputStream

0
	public InputStream GET(String url, String cookie) throws ACPException {
		try { 
			URL requestUrl = new URL(url.toString());
			URLConnection c = requestUrl.openConnection();
			if (cookie != null)
				c.addRequestProperty("Cookie", cookie);
			c.connect();
			if (log.isDebugEnabled())
				log.debug(url+" ["+cookie+"]");
			return c.getInputStream();
		} catch (Exception ex) {
			throw new ACPException(ex);
		} 
	} 
 
	public InputStream POST(String url, String content)
			throws ACPException { 
		try { 
			throw new IllegalArgumentException("Not implemented");
		} catch (Exception ex) {
			throw new ACPException(ex);