RequestOptions options = abderaClient.getDefaultRequestOptions();
options.setUseChunked(false);
// Post the entry
Response response = abderaClient.post(uri, entry, options);
// Google Calendar might return a 302 response with a new POST URI.
// If it does, get the new URI and post again
if (response.getStatus() == 302) {
uri = response.getLocation().toString();
response = abderaClient.post(uri, entry, options);
}
// Check the response
if (response.getStatus() == 201)
System.out.println("Success!");
else
System.out.println("Failed!");
}