copyPostedData(req, httpconn);
if (body != null) { conn.setDoOutput(true); httpconn.getOutputStream().write(body); }
	private URLContents fetchURLContent(HttpServletRequest req, URL url) throws IOException {		URLConnection conn = url.openConnection();				// handle basic auth		String auth, user, pass;		auth = req.getParameter(AUTH_PARAM);		user = req.getParameter(USER_PARAM);		pass = req.getParameter(PASS_PARAM);		if (auth != null && user != null && pass != null) {			if (!auth.equals(AUTH_BASIC)) {				ZimbraLog.zimlet.info("unsupported auth type: "+auth);				return new URLContents(url, HttpServletResponse.SC_BAD_REQUEST);			}			String cred = user + ":" + pass;			conn.setRequestProperty("Authorization", "Basic " + new String(Base64.encodeBase64(cred.getBytes())));		}				Enumeration headers = req.getHeaderNames();		while (headers.hasMoreElements()) {			String hdr = (String) headers.nextElement();			if (canProxyHeader(hdr)) {				//ZimbraLog.zimlet.info(hdr + ": " + req.getHeader(hdr));				conn.setRequestProperty(hdr, req.getHeader(hdr));			}		}		if (conn instanceof HttpURLConnection) {			HttpURLConnection httpconn = (HttpURLConnection) conn;						httpconn.setRequestMethod(req.getMethod());			copyPostedData(req, httpconn);			int status = httpconn.getResponseCode();			if (status != HttpURLConnection.HTTP_OK) {				ZimbraLog.zimlet.info("remote host(" + url + ") returned error on proxy request: "+status);			}		}		return new URLContents(conn, COMPRESS_CONTENTS);	}