try { HttpURLConnection connect = getConnection(RESOURCE_URI); connect.setRequestMethod("POST"); connect.setDoOutput(true); connect.setRequestProperty("ContentType", "text/xml");  Writer writer = new OutputStreamWriter(connect.getOutputStream(), "UTF-8"); writer.write(content); writer.close();  return connect; } catch (Exception e) { fail(e.getMessage()); } return null; }
try { HttpURLConnection connect = getConnection(RESOURCE_URI); connect.setRequestProperty("Authorization", "Basic " + credentials); connect.setRequestMethod("POST"); connect.setDoOutput(true); connect.setRequestProperty("ContentType", "text/xml");  Writer writer = new OutputStreamWriter(connect.getOutputStream(), "UTF-8"); writer.write(content); writer.close();  return connect; } catch (Exception e) { fail(e.getMessage()); } return null; }
	protected HttpURLConnection preparePost(String content) {		try {			HttpURLConnection connect = getConnection(RESOURCE_URI);			connect.setRequestMethod("POST");			connect.setDoOutput(true);			connect.setRequestProperty("ContentType", "text/xml");						Writer writer = new OutputStreamWriter(connect.getOutputStream(), "UTF-8");			writer.write(content);			writer.close();						return connect;	    } catch (Exception e) {            	        fail(e.getMessage()); 	    }	    return null;	}