if (title==null) {
conn.setRequestMethod("PUT");
} else {
conn.setRequestMethod("POST");
}
HttpAuthToken authToken = (HttpAuthToken) service.getAuthTokenFactory().getAuthToken();
String header = authToken.getAuthorizationHeader(uploadUrl, conn.getRequestMethod());
conn.setRequestProperty("Authorization", header);
conn.setRequestProperty("GData-Version", "3.0");
conn.setRequestProperty("Content-Type", mimeType);
if (title!=null) {
conn.setRequestProperty("Slug", title);