Code example for HttpDelete

Methods: addHeader

0
 
	public HttpResponse deleteObject(String Container, String Object)
			throws CloudServersException { 
		HttpResponse resp = null;
		CustomHttpClient httpclient = new CustomHttpClient(context);
		HttpDelete deleteObject = new HttpDelete(Account.getStorageUrl() + "/"
				+ Container + "/" + Object);
		Log.v(LOG, "the container (deleteObject) vairble " + Container + " "
				+ Object);
 
		deleteObject.addHeader("X-Auth-Token", Account.getAuthToken());
		httpclient.removeRequestInterceptorByClass(RequestExpectContinue.class);
 
		try { 
			resp = httpclient.execute(deleteObject);
		} catch (ClientProtocolException e) {
			Log.e("Error", "The operation failed due to status code: " + e.getLocalizedMessage());
		} catch (IOException e) {
			Log.e("Error", "The operation failed due to status code: " + e.getLocalizedMessage());
		} catch (FactoryConfigurationError e) {
			Log.e("Error", "The operation failed due to status code: " + e.getLocalizedMessage());